diff --git a/README.MD b/README.MD index 23ea7a6..de61b67 100644 --- a/README.MD +++ b/README.MD @@ -10,7 +10,13 @@ Etter å ha klonet prosjektet ned og gjort endringer kan du evaluere configene m før du bygger en maskin med: -`nix build .#nixosConfigurations..config.system.build.toplevel` +`nix build .#` + +hvis du vil være ekstra sikker på at alt bygger så kan du kjøre: + +`nix build .` for å bygge alle de viktige maskinene. + +NB: Dette kan ta opp til 15 minutter avhengig av hva som ligger i caches Husk å hvertfall stage nye filer om du har laget dem! diff --git a/flake.nix b/flake.nix index 0ae4f35..ed131af 100644 --- a/flake.nix +++ b/flake.nix @@ -21,12 +21,21 @@ outputs = { self, nixpkgs, matrix-next, pvv-calendar-bot, unstable, sops-nix, ... }@inputs: let + nixlib = nixpkgs.lib; systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; - forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); + forAllSystems = f: nixlib.genAttrs systems (system: f system); + allMachines = nixlib.mapAttrsToList (name: _: name) self.nixosConfigurations; + importantMachines = [ + "bekkalokk" + "bicep" + "brzeczyszczykiewicz" + "georg" + "ildkule" + ]; in { nixosConfigurations = let nixosConfig = nixpkgs: name: config: nixpkgs.lib.nixosSystem (nixpkgs.lib.recursiveUpdate @@ -95,5 +104,18 @@ devShells = forAllSystems (system: { default = nixpkgs.legacyPackages.${system}.callPackage ./shell.nix { }; }); + + packages = { + "x86_64-linux" = let + pkgs = nixpkgs.legacyPackages."x86_64-linux"; + in rec { + default = important-machines; + important-machines = pkgs.linkFarm "important-machines" + (nixlib.getAttrs importantMachines self.packages.x86_64-linux); + all-machines = pkgs.linkFarm "all-machines" + (nixlib.getAttrs allMachines self.packages.x86_64-linux); + } // nixlib.genAttrs allMachines + (machine: self.nixosConfigurations.${machine}.config.system.build.toplevel); + }; }; }