diff --git a/common/sops.nix b/common/sops.nix index df59122..423fb28 100644 --- a/common/sops.nix +++ b/common/sops.nix @@ -8,7 +8,7 @@ inputs.sops-nix.nixosModules.sops ]; - sops = { + sops = { defaultSopsFile = ../secrets.yaml; validateSopsFiles = false; diff --git a/flake-mods/allowUnfree.nix b/flake-mods/allowUnfree.nix index 739e2da..8331cd7 100644 --- a/flake-mods/allowUnfree.nix +++ b/flake-mods/allowUnfree.nix @@ -1,11 +1,11 @@ {inputs, ...}: { - perSystem = { system, ...}: { + perSystem = {system, ...}: { _module.args.pkgs = import inputs.nixpkgs { inherit system; config.allowUnfree = true; # The allowUnfreePredicate is due to home-manager#2942 (I haven't actually checked that it is necessary) # https://github.com/nix-community/home-manager/issues/2942 - config.allowUnfreePredicate = (_: true); + config.allowUnfreePredicate = _: true; }; }; } diff --git a/flake-mods/hm-flake-part.nix b/flake-mods/hm-flake-part.nix index 1a4a237..93c6ceb 100644 --- a/flake-mods/hm-flake-part.nix +++ b/flake-mods/hm-flake-part.nix @@ -1,21 +1,26 @@ -{ lib, flake-parts-lib, ... }: -let - inherit (lib) +{ + lib, + flake-parts-lib, + ... +}: let + inherit + (lib) mkOption types ; - inherit (flake-parts-lib) + inherit + (flake-parts-lib) mkTransposedPerSystemModule ; in -mkTransposedPerSystemModule { - name = "homeConfigurations"; - option = mkOption { - type = types.raw; - default = { }; - description = '' - home-manager configs - ''; - }; - file = ./hm-flake-part.nix; -} + mkTransposedPerSystemModule { + name = "homeConfigurations"; + option = mkOption { + type = types.raw; + default = {}; + description = '' + home-manager configs + ''; + }; + file = ./hm-flake-part.nix; + } diff --git a/flake-mods/hm.nix b/flake-mods/hm.nix index 6c102a4..d29ac9f 100644 --- a/flake-mods/hm.nix +++ b/flake-mods/hm.nix @@ -1,8 +1,19 @@ -{inputs, lib, ...}: { +{ + inputs, + lib, + ... +}: { imports = [ ./hm-flake-part.nix ]; - perSystem = { config, self', inputs', pkgs, system, ... }: let + perSystem = { + config, + self', + inputs', + pkgs, + system, + ... + }: let # split system (e.g. x86_64-linux) into os and arch splitSystem = lib.splitString "-" system; os = builtins.elemAt splitSystem 0; @@ -14,7 +25,7 @@ ../home inputs.nixvim.homeManagerModules.nixvim inputs.sops-nix.homeManagerModules.sops - { inherit os arch; } + {inherit os arch;} ]; extraSpecialArgs = {inherit inputs;}; }; diff --git a/flake-mods/nixosHosts.nix b/flake-mods/nixosHosts.nix index 59ffb30..1705e75 100644 --- a/flake-mods/nixosHosts.nix +++ b/flake-mods/nixosHosts.nix @@ -1,11 +1,21 @@ -{inputs, lib, ...}: { - flake.nixosConfigurations = lib.genAttrs [ - "asmodeus" "seraphim" "lilith" "lambda" "beleth" - ] (name: inputs.nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ../hosts/x86_64-linux/${name} - ]; - specialArgs = {inherit inputs;}; - }); +{ + inputs, + lib, + ... +}: { + flake.nixosConfigurations = + lib.genAttrs [ + "asmodeus" + "seraphim" + "lilith" + "lambda" + "beleth" + ] (name: + inputs.nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ../hosts/x86_64-linux/${name} + ]; + specialArgs = {inherit inputs;}; + }); } diff --git a/flake.nix b/flake.nix index 82fe77b..5b14605 100644 --- a/flake.nix +++ b/flake.nix @@ -42,14 +42,22 @@ }; #inputs.agenix.url = "github:ryantm/agenix"; - outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { + outputs = inputs @ {flake-parts, ...}: + flake-parts.lib.mkFlake {inherit inputs;} { imports = [ ./flake-mods/hm.nix ./flake-mods/nixosHosts.nix ./flake-mods/allowUnfree.nix ]; - systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; - perSystem = { config, self', inputs', pkgs, system, ... }: {}; + systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"]; + perSystem = { + config, + self', + inputs', + pkgs, + system, + ... + }: {}; flake = {}; }; } diff --git a/home/default.nix b/home/default.nix index 74ff029..2101617 100644 --- a/home/default.nix +++ b/home/default.nix @@ -10,7 +10,10 @@ ./system.nix ]; home.username = "xqtc"; - home.homeDirectory = if config.os == "linux" then "/home/xqtc" else "/Users/xqtc"; + home.homeDirectory = + if config.os == "linux" + then "/home/xqtc" + else "/Users/xqtc"; programs.wezterm = { enable = true; diff --git a/home/modules/firefox.nix b/home/modules/firefox.nix index 3814f8d..da7fbb6 100644 --- a/home/modules/firefox.nix +++ b/home/modules/firefox.nix @@ -7,7 +7,10 @@ ... }: with inputs; { - home.sessionVariables.DEFAULT_BROWSER = if (config.os == "linux") then "${pkgs.firefox}/bin/firefox" else "firefox"; + home.sessionVariables.DEFAULT_BROWSER = + if (config.os == "linux") + then "${pkgs.firefox}/bin/firefox" + else "firefox"; programs.firefox = lib.mkIf (config.os == "linux") { enable = true; diff --git a/home/modules/home-pkgs.nix b/home/modules/home-pkgs.nix index 438b8c6..b0cf8f0 100644 --- a/home/modules/home-pkgs.nix +++ b/home/modules/home-pkgs.nix @@ -9,119 +9,115 @@ maxfetch = pkgs.writeScriptBin "maxfetch" (builtins.readFile ../config-files/maxfetch.sh); startdwl = pkgs.writeScriptBin "startdwl" (builtins.readFile ../config-files/startdwl.sh); in { - home.packages = (lib.optionals (config.os == "linux") (with pkgs; [ - yubioath-flutter - steam - heroic - protonup-qt - via - telegram-desktop - jetbrains.rust-rover - tutanota-desktop - bitwarden-desktop - bottles - flameshot - grim - networkmanagerapplet - nextcloud-client - swaylock-effects - wdisplays - brightnessctl - pavucontrol - swayfx - sway-contrib.grimshot - libnotify - swww - strace - ltrace - ghidra - imhex - qmk-udev-rules - jellyfin-media-player - signal-desktop - # ida-free - # spotify - ])) ++ (with pkgs; [ - nh + home.packages = + (lib.optionals (config.os == "linux") (with pkgs; [ + yubioath-flutter + steam + heroic + protonup-qt + via + telegram-desktop + jetbrains.rust-rover + tutanota-desktop + bitwarden-desktop + bottles + flameshot + grim + networkmanagerapplet + nextcloud-client + swaylock-effects + wdisplays + brightnessctl + pavucontrol + swayfx + sway-contrib.grimshot + libnotify + swww + strace + ltrace + ghidra + imhex + qmk-udev-rules + jellyfin-media-player + signal-desktop + # ida-free + # spotify + ])) + ++ (with pkgs; [ + nh - ncspot + ncspot - wakatime-cli + wakatime-cli - neofetch - # uwufetch - maxfetch - startdwl - btop - iftop - ranger + neofetch + # uwufetch + maxfetch + startdwl + btop + iftop + ranger - cargo-mommy + cargo-mommy - just - fzf + just + fzf - catppuccin-kde + catppuccin-kde - typst + typst - # marked as broken - # anki + # marked as broken + # anki - freetube + freetube - openvpn + openvpn - moodle-dl + moodle-dl + obsidian - obsidian + prismlauncher + # marked as broken + # syncthingtray + rbw - prismlauncher + nodejs - # marked as broken - # syncthingtray + # cabal + ghc + # marked as broken + # rizin + # (cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb])) - rbw + nerdfonts + ipafont + vesktop + element-desktop - nodejs + qbittorrent + nicotine-plus - # cabal - ghc + qmk - # marked as broken - # rizin - # (cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb])) + neovide + xournalpp + zathura - nerdfonts - ipafont + ripgrep - vesktop - element-desktop + sayonara + # mpv + feishin - qbittorrent - nicotine-plus + nix-tree - qmk - - neovide - - xournalpp - zathura - - ripgrep - - sayonara - # mpv - feishin - - nix-tree - - nixos-icons - ]); + nixos-icons + ]); } diff --git a/home/modules/shell.nix b/home/modules/shell.nix index 107830f..284c617 100644 --- a/home/modules/shell.nix +++ b/home/modules/shell.nix @@ -5,7 +5,10 @@ ... }: { programs = { - zsh.enable = if config.os == "linux" then true else false; + zsh.enable = + if config.os == "linux" + then true + else false; atuin = { enable = true; enableNushellIntegration = true; diff --git a/home/modules/sops.nix b/home/modules/sops.nix index f46dd75..679eaef 100644 --- a/home/modules/sops.nix +++ b/home/modules/sops.nix @@ -10,7 +10,10 @@ age = { sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; - keyFile = if (config.os == "linux") then "/home/xqtc/.config/sops/age/keys.txt" else "/Users/xqtc/.config/sops/age/keys.txt"; + keyFile = + if (config.os == "linux") + then "/home/xqtc/.config/sops/age/keys.txt" + else "/Users/xqtc/.config/sops/age/keys.txt"; generateKey = true; }; }; diff --git a/home/modules/ssh.nix b/home/modules/ssh.nix index d47997d..1bd2cfc 100644 --- a/home/modules/ssh.nix +++ b/home/modules/ssh.nix @@ -14,19 +14,19 @@ # keyFile = "/var/lib/sops/age/keys.txt"; # generateKey = true; # }; - secrets = { - "xqtc_private" = { - # path = if (pkgs.system == "aarch64-darwin") then "/Users/xqtc/.ssh/id_ed25519" else "/home/xqtc/.ssh/id_ed25519"; - path = config.home.homeDirectory + "/.ssh/id_ed25519"; - # owner = "xqtc"; - mode = "600"; + secrets = { + "xqtc_private" = { + # path = if (pkgs.system == "aarch64-darwin") then "/Users/xqtc/.ssh/id_ed25519" else "/home/xqtc/.ssh/id_ed25519"; + path = config.home.homeDirectory + "/.ssh/id_ed25519"; + # owner = "xqtc"; + mode = "600"; + }; + "xqtc_public" = { + # path = if (pkgs.system == "aarch64-darwin") then "/Users/xqtc/.ssh/id_ed25519.pub" else "/home/xqtc/.ssh/id_ed25519.pub"; + path = config.home.homeDirectory + "/.ssh/id_ed25519.pub"; + # owner = "xqtc"; + mode = "640"; + }; }; - "xqtc_public" = { - # path = if (pkgs.system == "aarch64-darwin") then "/Users/xqtc/.ssh/id_ed25519.pub" else "/home/xqtc/.ssh/id_ed25519.pub"; - path = config.home.homeDirectory + "/.ssh/id_ed25519.pub"; - # owner = "xqtc"; - mode = "640"; - }; - }; }; }