diff --git a/flake.lock b/flake.lock index 5dc54f8..27af171 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,29 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager_2", + "nixpkgs": [ + "ragenix", + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1736955230, + "narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=", + "owner": "ryantm", + "repo": "agenix", + "rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, "base16": { "inputs": { "fromYaml": "fromYaml" @@ -67,14 +91,52 @@ "type": "github" } }, + "crane": { + "locked": { + "lastModified": 1741481578, + "narHash": "sha256-JBTSyJFQdO3V8cgcL08VaBUByEU6P5kXbTJN6R0PFQo=", + "owner": "ipetkov", + "repo": "crane", + "rev": "bb1c9567c43e4434f54e9481eb4b8e8e0d50f0b5", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "darwin": { + "inputs": { + "nixpkgs": [ + "ragenix", + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1700795494, + "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "firefox-gnome-theme": { "flake": false, "locked": { - "lastModified": 1739223196, - "narHash": "sha256-vAxN2f3rvl5q62gQQjZGVSvF93nAsOxntuFz+e/655w=", + "lastModified": 1742173552, + "narHash": "sha256-8EQS6zY47hVa3jWG9d2MuHK+1JmG/6vdp8gEd2eKFow=", "owner": "rafaelmardojai", "repo": "firefox-gnome-theme", - "rev": "a89108e6272426f4eddd93ba17d0ea101c34fb21", + "rev": "072ee5d3e8b6f575a31cc294054537dc841d5049", "type": "github" }, "original": { @@ -86,11 +148,11 @@ "firefox-gnome-theme_2": { "flake": false, "locked": { - "lastModified": 1739223196, - "narHash": "sha256-vAxN2f3rvl5q62gQQjZGVSvF93nAsOxntuFz+e/655w=", + "lastModified": 1741628778, + "narHash": "sha256-RsvHGNTmO2e/eVfgYK7g+eYEdwwh7SbZa+gZkT24MEA=", "owner": "rafaelmardojai", "repo": "firefox-gnome-theme", - "rev": "a89108e6272426f4eddd93ba17d0ea101c34fb21", + "rev": "5a81d390bb64afd4e81221749ec4bffcbeb5fa80", "type": "github" }, "original": { @@ -119,11 +181,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1738453229, - "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", + "lastModified": 1741352980, + "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", + "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9", "type": "github" }, "original": { @@ -155,6 +217,24 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "inputs": { "systems": [ "stylix", @@ -204,11 +284,11 @@ ] }, "locked": { - "lastModified": 1737465171, - "narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=", + "lastModified": 1741379162, + "narHash": "sha256-srpAbmJapkaqGRE3ytf3bj4XshspVR5964OX5LfjDWc=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", + "rev": "b5a62751225b2f62ff3147d0a334055ebadcd5cc", "type": "github" }, "original": { @@ -258,22 +338,47 @@ }, "home-manager": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1740699498, - "narHash": "sha256-r9hkKzX99CGiP1ZqH0e+SWKK4CMsRNRLyotuwrUjhTI=", + "lastModified": 1742508854, + "narHash": "sha256-vQQTIl4+slrcu7ftVKNBql9ngBdY0dcYGujdT7zIVp0=", "owner": "nix-community", "repo": "home-manager", - "rev": "b71edac7a3167026aabea82a54d08b1794088c21", + "rev": "da0181819479ddc034a3db9a77ed21ea3bcc0668", "type": "github" }, "original": { - "id": "home-manager", - "type": "indirect" + "owner": "nix-community", + "repo": "home-manager", + "type": "github" } }, "home-manager_2": { + "inputs": { + "nixpkgs": [ + "ragenix", + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703113217, + "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_3": { "inputs": { "nixpkgs": [ "stylix", @@ -281,11 +386,11 @@ ] }, "locked": { - "lastModified": 1740347597, - "narHash": "sha256-st5q9egkPGz8TUcVVlIQX7y6G3AzHob+6M963bwVq74=", + "lastModified": 1741635347, + "narHash": "sha256-2aYfV44h18alHXopyfL4D9GsnpE5XlSVkp4MGe586VU=", "owner": "nix-community", "repo": "home-manager", - "rev": "12e26a74e5eb1a31e13daaa08858689e25ebd449", + "rev": "7fb8678716c158642ac42f9ff7a18c0800fea551", "type": "github" }, "original": { @@ -297,14 +402,14 @@ "nix-gaming": { "inputs": { "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1740552472, - "narHash": "sha256-KiGmSYyO9MJJqYD7nbQ0NQgsAR2VVY/wRra0Bob4KtE=", + "lastModified": 1742262357, + "narHash": "sha256-6JGR5I4cuFFun3AJKPnMPz6PKUPywIH+AFYROUFRvYQ=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "452fbd6a30f128dddf26c63f727cf685b5af5658", + "rev": "53eda8bba79a2c28782734bca51d70ecffb82d74", "type": "github" }, "original": { @@ -315,39 +420,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739736696, - "narHash": "sha256-zON2GNBkzsIyALlOCFiEBcIjI4w38GYOb+P+R4S8Jsw=", + "lastModified": 1741865919, + "narHash": "sha256-4thdbnP6dlbdq+qZWTsm4ffAwoS8Tiq1YResB+RP6WE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d74a2335ac9c133d6bbec9fc98d91a77f1604c1f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1738452942, - "narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1740019556, - "narHash": "sha256-vn285HxnnlHLWnv59Og7muqECNMS33mWLM14soFIv2g=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "dad564433178067be1fbdfcce23b546254b6d641", + "rev": "573c650e8a14b2faa0041645ab18aed7e60f0c9a", "type": "github" }, "original": { @@ -357,13 +434,28 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs-lib": { "locked": { - "lastModified": 1740560979, - "narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=", + "lastModified": 1740877520, + "narHash": "sha256-oiwv/ZK/2FhGxrCkQkB83i7GnWXPPLzoqFHpDD3uYpk=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "147dee35aab2193b174e4c0868bd80ead5ce755c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1742288794, + "narHash": "sha256-Txwa5uO+qpQXrNG4eumPSD+hHzzYi/CdaM80M9XRLCo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5135c59491985879812717f4c9fea69604e7f26f", + "rev": "b6eaf97c6960d97350c584de1b6dcff03c9daf42", "type": "github" }, "original": { @@ -373,13 +465,13 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { - "lastModified": 1740367490, - "narHash": "sha256-WGaHVAjcrv+Cun7zPlI41SerRtfknGQap281+AakSAw=", + "lastModified": 1741513245, + "narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0196c0175e9191c474c26ab5548db27ef5d34b05", + "rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1", "type": "github" }, "original": { @@ -399,11 +491,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1740408283, - "narHash": "sha256-2xECnhgF3MU9YjmvOkrRp8wRFo2OjjewgCtlfckhL5s=", + "lastModified": 1741693509, + "narHash": "sha256-emkxnsZstiJWmGACimyAYqIKz2Qz5We5h1oBVDyQjLw=", "owner": "nix-community", "repo": "NUR", - "rev": "496a4a11162bdffb9a7b258942de138873f019f7", + "rev": "5479646b2574837f1899da78bdf9a48b75a9fb27", "type": "github" }, "original": { @@ -420,11 +512,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1740736352, - "narHash": "sha256-E9nELhEPfvduzLmLOIplttTi44GhEv6Kup3yTtDYYf8=", + "lastModified": 1742493140, + "narHash": "sha256-deeSwFTs5mAR0lHIccRrND/+YIhgJwdXwJE9iHIP8ec=", "owner": "wamserma", "repo": "flake-programs-sqlite", - "rev": "c31d1f3726a951815f27dc2db631c14fd958efe8", + "rev": "84d4a332c0f98637d504f9d5ad5610a263d271fe", "type": "github" }, "original": { @@ -433,17 +525,63 @@ "type": "github" } }, + "ragenix": { + "inputs": { + "agenix": "agenix", + "crane": "crane", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1741508717, + "narHash": "sha256-iQf1WdNxaApOFHIx4RLMRZ4f8g+8Xp0Z1/E/Mz2rLxY=", + "owner": "yaxitech", + "repo": "ragenix", + "rev": "2a2bea99d74927e54adf53cbf113219def67d5c9", + "type": "github" + }, + "original": { + "owner": "yaxitech", + "repo": "ragenix", + "type": "github" + } + }, "root": { "inputs": { "firefox-gnome-theme": "firefox-gnome-theme", "home-manager": "home-manager", "nix-gaming": "nix-gaming", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "programsdb": "programsdb", + "ragenix": "ragenix", "stylix": "stylix", "wrapper-manager": "wrapper-manager" } }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "ragenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741400194, + "narHash": "sha256-tEpgT+q5KlGjHSm8MnINgTPErEl8YDzX3Eps8PVc09g=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "16b6045a232fea0e9e4c69e55a6e269607dd8e3f", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "stylix": { "inputs": { "base16": "base16", @@ -452,13 +590,13 @@ "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme_2", "flake-compat": "flake-compat", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "git-hooks": "git-hooks", "gnome-shell": "gnome-shell", - "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_4", + "home-manager": "home-manager_3", + "nixpkgs": "nixpkgs_3", "nur": "nur", - "systems": "systems", + "systems": "systems_3", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -466,11 +604,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1740734415, - "narHash": "sha256-QRux8OnLOvHoMB6jRlQgfffj9y3JEGSdWclB4blGLWM=", + "lastModified": 1742496983, + "narHash": "sha256-UpJrU0DEhNLVZwL/RPVOEUHCG6iDOVDoYelkmgS4V38=", "owner": "danth", "repo": "stylix", - "rev": "c74352a1459ac0d350b22a3a45bbaa18ab7b7e2d", + "rev": "7e9906679d384472849272e5a5eef7adbdb1d87f", "type": "github" }, "original": { @@ -494,6 +632,36 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tinted-foot": { "flake": false, "locked": { @@ -531,11 +699,11 @@ "tinted-schemes": { "flake": false, "locked": { - "lastModified": 1740351358, - "narHash": "sha256-Hdk850xgAd3DL8KX0AbyU7tC834d3Lej1jOo3duWiOA=", + "lastModified": 1741468895, + "narHash": "sha256-YKM1RJbL68Yp2vESBqeZQBjTETXo8mCTTzLZyckCfZk=", "owner": "tinted-theming", "repo": "schemes", - "rev": "a1bc2bd89e693e7e3f5764cfe8114e2ae150e184", + "rev": "47c8c7726e98069cade5827e5fb2bfee02ce6991", "type": "github" }, "original": { @@ -547,11 +715,11 @@ "tinted-tmux": { "flake": false, "locked": { - "lastModified": 1740272597, - "narHash": "sha256-/etfUV3HzAaLW3RSJVwUaW8ULbMn3v6wbTlXSKbcoWQ=", + "lastModified": 1740877430, + "narHash": "sha256-zWcCXgdC4/owfH/eEXx26y5BLzTrefjtSLFHWVD5KxU=", "owner": "tinted-theming", "repo": "tinted-tmux", - "rev": "b6c7f46c8718cc484f2db8b485b06e2a98304cd0", + "rev": "d48ee86394cbe45b112ba23ab63e33656090edb4", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index c420f20..4c26eff 100755 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,14 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + ragenix = { + url = "github:yaxitech/ragenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; stylix.url = "github:danth/stylix"; nix-gaming.url = "github:fufexan/nix-gaming"; firefox-gnome-theme = { @@ -17,49 +25,43 @@ }; }; - outputs = { - self, - stylix, - nixpkgs, - home-manager, - ... - } @ inputs: let + outputs = inputs: let dirUtils = { - opt = nixpkgs.lib.optionals; + opt = inputs.nixpkgs.lib.optionals; dirFiles = dir: map (file: "${dir}/${file}") (builtins.attrNames (builtins.readDir dir)); }; system = hostname: isDesktop: - with dirUtils; - nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { - inherit inputs self isDesktop dirUtils; - }; - - modules = - [ - ./wrappers - inputs.nix-gaming.nixosModules.pipewireLowLatency - ] - ++ dirFiles "${self}/${hostname}" - ++ dirFiles ./modules/common - ++ opt isDesktop ( - (dirFiles ./modules/common-desktop) - ++ [ - stylix.nixosModules.stylix - ./stylix.nix - - home-manager.nixosModules.home-manager - ./home-manager.nix - ] - ); + inputs.nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit inputs isDesktop dirUtils; }; + + modules = with dirUtils; + [ + ./wrappers + inputs.ragenix.nixosModules.default + inputs.nix-gaming.nixosModules.pipewireLowLatency + ] + ++ dirFiles "${inputs.self}/${hostname}" + ++ dirFiles ./modules/common + ++ opt isDesktop ( + (dirFiles ./modules/common-desktop) + ++ [ + inputs.stylix.nixosModules.stylix + ./stylix.nix + + inputs.home-manager.nixosModules.home-manager + ./home-manager.nix + ] + ); + }; in { nixosConfigurations = { "quadraticpc" = system "quadraticpc" true; "quadtop" = system "quadtop" true; }; - formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra; + formatter.x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.alejandra; }; } diff --git a/modules/common/backup.nix b/modules/common/backup.nix index ff18edd..f945919 100644 --- a/modules/common/backup.nix +++ b/modules/common/backup.nix @@ -1 +1 @@ -{self, ...}: {environment.etc."backup".source = self;} +{inputs, ...}: {environment.etc."backup".source = inputs.self;} diff --git a/modules/common/git.nix b/modules/common/git.nix index 8734224..31d0d75 100644 --- a/modules/common/git.nix +++ b/modules/common/git.nix @@ -7,5 +7,5 @@ }; }; - environment.systemPackages = [pkgs.git-credential-manager]; + environment.systemPackages = [pkgs.gh]; } diff --git a/modules/common/ragenix.nix b/modules/common/ragenix.nix new file mode 100644 index 0000000..f72a4d0 --- /dev/null +++ b/modules/common/ragenix.nix @@ -0,0 +1,13 @@ +{ + inputs, + lib, + ... +}: { + environment.systemPackages = [inputs.ragenix.packages.x86_64-linux.default]; + + age.secrets = with lib; + listToAttrs (mapAttrsToList (name: _: { + name = name; + value.file = name; + }) (import ../../secrets/secrets.nix)); +} diff --git a/secrets/secrets.nix b/secrets/secrets.nix new file mode 100644 index 0000000..7a339f5 --- /dev/null +++ b/secrets/secrets.nix @@ -0,0 +1,6 @@ +{lib, ...}: +with builtins; + listToAttrs (map (file: { + name = file; + value.publicKeys = split "\n" (readFile (fetchurl "https://github.com/Henry-Hiles.keys")); + }) (filter (name: lib.hasSuffix ".age" name) (builtins.attrNames (builtins.readDir ./.))))