diff --git a/flake.lock b/flake.lock index f18d58e..e9388b4 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,21 @@ { "nodes": { "crane": { + "locked": { + "lastModified": 1766774972, + "narHash": "sha256-8qxEFpj4dVmIuPn9j9z6NTbU+hrcGjBOvaxTzre5HmM=", + "owner": "ipetkov", + "repo": "crane", + "rev": "01bc1d404a51a0a07e9d8759cd50a7903e218c82", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "crane_2": { "locked": { "lastModified": 1769287525, "narHash": "sha256-gABuYA6BzoRMLuPaeO5p7SLrpd4qExgkwEmYaYQY4bM=", @@ -15,7 +30,45 @@ "type": "github" } }, + "fenix": { + "inputs": { + "nixpkgs": [ + "flox", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1766904428, + "narHash": "sha256-ZNm41Tuh+PHpoV7qEFnhgNu/B6Co9c+rIttcr7TCaMo=", + "owner": "nix-community", + "repo": "fenix", + "rev": "3b672faf8fcc01eb63856b69afe7a12dcb7c78fe", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1761588595, + "narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1767039857, @@ -64,7 +117,50 @@ "type": "github" } }, + "flox": { + "inputs": { + "crane": "crane", + "fenix": "fenix", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1770152711, + "narHash": "sha256-URH0UkeXCofieKJ0Hbh98O+9qZwGgvwfkKP0zL9wUIo=", + "owner": "flox", + "repo": "flox", + "rev": "4093242d704102ca898e64631ff196f1ddeeb883", + "type": "github" + }, + "original": { + "owner": "flox", + "repo": "flox", + "type": "github" + } + }, "gitignore": { + "inputs": { + "nixpkgs": [ + "flox", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_2": { "inputs": { "nixpkgs": [ "lanzaboote", @@ -88,7 +184,7 @@ }, "lanzaboote": { "inputs": { - "crane": "crane", + "crane": "crane_2", "nixpkgs": [ "nixpkgs" ], @@ -184,6 +280,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1766651565, + "narHash": "sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU=", + "owner": "flox", + "repo": "nixpkgs", + "rev": "3e2499d5539c16d0d173ba53552a4ff8547f4539", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "stable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1769741972, "narHash": "sha256-RxSg1EioTWNpoLaykiT1UQKTo/K0PPdLqCyQgNjNqWs=", @@ -201,8 +313,8 @@ }, "pre-commit": { "inputs": { - "flake-compat": "flake-compat", - "gitignore": "gitignore", + "flake-compat": "flake-compat_2", + "gitignore": "gitignore_2", "nixpkgs": [ "lanzaboote", "nixpkgs" @@ -222,13 +334,54 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "flox", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1765911976, + "narHash": "sha256-t3T/xm8zstHRLx+pIHxVpQTiySbKqcQbK+r+01XVKc0=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "b68b780b69702a090c8bb1b973bab13756cc7a27", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { + "flox": "flox", "lanzaboote": "lanzaboote", "lix-module": "lix-module", "nix-flatpak": "nix-flatpak", "nix-index-database": "nix-index-database", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1766863309, + "narHash": "sha256-LLGFE8MXlmH9FfPjZAPFnrc0vsUryhIDwcJQgqnpSAg=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "546d1ffbfd296e06424236cd467f41cb6fe63b2e", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" } }, "rust-overlay": { diff --git a/flake.nix b/flake.nix index c856fd5..2520d63 100644 --- a/flake.nix +++ b/flake.nix @@ -12,37 +12,35 @@ lix-module.inputs.nixpkgs.follows = "nixpkgs"; lanzaboote.url = "github:nix-community/lanzaboote"; lanzaboote.inputs.nixpkgs.follows = "nixpkgs"; + flox.url = "github:flox/flox"; }; - outputs = inputs@{ self, nixpkgs, ... }: + outputs = + inputs@{ self, nixpkgs, ... }: let lib = nixpkgs.lib; hostFiles = builtins.attrNames (builtins.readDir ./hosts); - hostNames = - lib.filter (name: - lib.hasSuffix ".nix" name - && !(lib.hasSuffix "-hardware.nix" name) - && name != "iso.nix" - ) - hostFiles; - mkHost = name: lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; - modules = [ (./hosts + "/${name}.nix") ]; - }; - in { - nixosConfigurations = - lib.genAttrs (map (lib.removeSuffix ".nix") hostNames) mkHost - // { - installer = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; - modules = [ ./hosts/iso.nix ]; - }; + hostNames = lib.filter ( + name: lib.hasSuffix ".nix" name && !(lib.hasSuffix "-hardware.nix" name) && name != "iso.nix" + ) hostFiles; + mkHost = + name: + lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ (./hosts + "/${name}.nix") ]; }; + in + { + nixosConfigurations = lib.genAttrs (map (lib.removeSuffix ".nix") hostNames) mkHost // { + installer = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ ./hosts/iso.nix ]; + }; + }; - packages.x86_64-linux.install-iso = - self.nixosConfigurations.installer.config.system.build.isoImage; + packages.x86_64-linux.install-iso = self.nixosConfigurations.installer.config.system.build.isoImage; packages.x86_64-linux.default = self.packages.x86_64-linux.install-iso; }; } diff --git a/hosts/nanuqsaurus.nix b/hosts/nanuqsaurus.nix index 943aff2..c7e34d6 100644 --- a/hosts/nanuqsaurus.nix +++ b/hosts/nanuqsaurus.nix @@ -19,6 +19,7 @@ ../modules/desktop/desktop-entries.nix ../modules/desktop/file-manager.nix ../modules/desktop/gnome-minimal.nix + ../modules/development/flox.nix ../modules/users/admin.nix ] ++ lib.optionals (builtins.pathExists ./nanuqsaurus-hardware.nix) [ diff --git a/modules/development/flox.nix b/modules/development/flox.nix new file mode 100644 index 0000000..5747157 --- /dev/null +++ b/modules/development/flox.nix @@ -0,0 +1,17 @@ +{ + lib, + pkgs, + inputs, + ... +}: + +{ + nix.settings.trusted-substituters = lib.mkAfter [ "https://cache.flox.dev" ]; + nix.settings.trusted-public-keys = lib.mkAfter [ + "flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs=" + ]; + + environment.systemPackages = lib.mkAfter [ + inputs.flox.packages.${pkgs.system}.flox + ]; +} diff --git a/modules/system/packages.nix b/modules/system/packages.nix index e6123da..e738730 100644 --- a/modules/system/packages.nix +++ b/modules/system/packages.nix @@ -3,6 +3,8 @@ { # Baseline system tools available everywhere; users run Home Manager standalone. config.environment.systemPackages = lib.mkAfter [ + pkgs.devbox + pkgs.devenv pkgs.distrobox pkgs.distroshelf pkgs.dnsmasq