mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-02-22 15:15:50 -06:00
make system configurable
This commit is contained in:
parent
f74deacae0
commit
186fda577e
3 changed files with 26 additions and 11 deletions
|
@ -64,7 +64,7 @@ let
|
|||
rec {
|
||||
default = oizys;
|
||||
oizys = pkgs.callPackage ../pkgs/oizys { };
|
||||
iso = mkIso.config.system.build.isoImage;
|
||||
iso-x86_64-linux = (mkIso "x86_64-linux").config.system.build.isoImage;
|
||||
}
|
||||
// (import ../pkgs { inherit pkgs lib inputs; })
|
||||
);
|
||||
|
|
|
@ -140,6 +140,12 @@ let
|
|||
|
||||
pathFromHostName = host: ../. + "/hosts/${host}";
|
||||
hostFiles = host: host |> pathFromHostName |> listFilesRecursive |> filter isNixFile;
|
||||
hostSystem =
|
||||
host:
|
||||
let
|
||||
f = (host |> pathFromHostName) + "/settings/system";
|
||||
in
|
||||
if pathExists f then readLinesNoComment f else "x86_64-linux";
|
||||
|
||||
# if the specified path doesn't exist returns an empty array
|
||||
tryReadLinesNoComment = f: if pathExists f then (readLinesNoComment f) else [ ];
|
||||
|
@ -208,6 +214,7 @@ in
|
|||
listify
|
||||
loadOverlays
|
||||
hostFiles
|
||||
hostSystem
|
||||
oizysSettings
|
||||
tryPkgsFromFile
|
||||
;
|
||||
|
|
|
@ -15,6 +15,7 @@ let
|
|||
listify
|
||||
readSettings
|
||||
hostFiles
|
||||
hostSystem
|
||||
;
|
||||
flake = flakeFromSystem "x86_64-linux";
|
||||
nixosModules = names: names |> listify |> map (n: inputs.${n}.nixosModules.default);
|
||||
|
@ -30,22 +31,29 @@ let
|
|||
;
|
||||
};
|
||||
|
||||
mkIso = nixosSystem {
|
||||
modules =
|
||||
[
|
||||
{ nixpkgs.hostPlatform = "x86_64-linux"; }
|
||||
]
|
||||
++ (nixosModules "lix-module")
|
||||
++ (selfModules "essentials|iso");
|
||||
specialArgs = commonSpecialArgs;
|
||||
};
|
||||
mkIso =
|
||||
system:
|
||||
nixosSystem {
|
||||
system = system;
|
||||
modules =
|
||||
[
|
||||
{ nixpkgs.hostPlatform = system; }
|
||||
]
|
||||
++ (nixosModules "lix-module")
|
||||
++ (selfModules "essentials|iso");
|
||||
specialArgs = commonSpecialArgs;
|
||||
};
|
||||
|
||||
mkSystem =
|
||||
hostName:
|
||||
let
|
||||
system = hostSystem hostName;
|
||||
in
|
||||
nixosSystem {
|
||||
inherit system;
|
||||
modules =
|
||||
[
|
||||
{ nixpkgs.hostPlatform = "x86_64-linux"; }
|
||||
{ nixpkgs.hostPlatform = system; }
|
||||
]
|
||||
++ (selfModules ''oizys'')
|
||||
++ (nixosModules ''lix-module|sops-nix'')
|
||||
|
|
Loading…
Add table
Reference in a new issue