Clean up legibility of flake.nix
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
{ agenix, darwin, nixstable, nixunstable, overlays, ... }:
|
||||||
|
let
|
||||||
|
mac = {
|
||||||
|
system ? "aarch64-darwin",
|
||||||
|
name,
|
||||||
|
channel ? nixunstable,
|
||||||
|
extraMods ? []
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
nixpkgs = channel;
|
||||||
|
in darwin.lib.darwinSystem {
|
||||||
|
inherit system;
|
||||||
|
specialArgs = { inherit nixpkgs; };
|
||||||
|
modules = [
|
||||||
|
{ nixpkgs.overlays = overlays; }
|
||||||
|
agenix.nixosModule
|
||||||
|
../modules-all
|
||||||
|
../modules-darwin
|
||||||
|
./${name}
|
||||||
|
] ++ extraMods;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
"C02G48H8MD6R" = mac { system = "x86_64-darwin"; name = "work"; };
|
||||||
|
la23002 = mac { name = "ivr"; };
|
||||||
|
}
|
||||||
Generated
+23
-23
@@ -103,18 +103,18 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"home-manager": {
|
"hm": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"stable"
|
"nixstable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1683543852,
|
"lastModified": 1683813037,
|
||||||
"narHash": "sha256-aS9qNcg9GwSYFLCWa3Lw+2nVPG11mmQ3B7Oka1hh04M=",
|
"narHash": "sha256-UMEXfYLVcI4p0JUHQD07UWglqj7XUw6xhdJqqNRu4KY=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "3f3fa731ad0f99741d4dc98e8e1287b45e30b452",
|
"rev": "d97e8f8861a7ad3cb2f72adf5b2cd14ab302c593",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -156,6 +156,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixstable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1682600000,
|
||||||
|
"narHash": "sha256-ha4BehR1dh8EnXSoE1m/wyyYVvHI9txjW4w5/oxsW5Y=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "50fc86b75d2744e1ab3837ef74b53f103a9b55a0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-22.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixunstable": {
|
"nixunstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1682879489,
|
"lastModified": 1682879489,
|
||||||
@@ -193,29 +209,13 @@
|
|||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
"ffmac": "ffmac",
|
"ffmac": "ffmac",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"home-manager": "home-manager",
|
"hm": "hm",
|
||||||
|
"nixstable": "nixstable",
|
||||||
"nixunstable": "nixunstable",
|
"nixunstable": "nixunstable",
|
||||||
"nurpkgs": "nurpkgs",
|
"nurpkgs": "nurpkgs",
|
||||||
"stable": "stable",
|
|
||||||
"wsl": "wsl"
|
"wsl": "wsl"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"stable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1672580127,
|
|
||||||
"narHash": "sha256-3lW3xZslREhJogoOkjeZtlBtvFMyxHku7I/9IVehhT8=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "0874168639713f547c05947c76124f78441ea46c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-22.05",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wsl": {
|
"wsl": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
description = "Greg's machines!";
|
description = "Greg's machines!";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
stable.url = "github:nixos/nixpkgs/nixos-22.05";
|
nixstable.url = "github:nixos/nixpkgs/nixos-22.05";
|
||||||
nixunstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixunstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
agenix.url = "github:ryantm/agenix";
|
agenix.url = "github:ryantm/agenix";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
home-manager = {
|
hm = {
|
||||||
url = "github:nix-community/home-manager/master";
|
url = "github:nix-community/home-manager/master";
|
||||||
inputs.nixpkgs.follows = "stable";
|
inputs.nixpkgs.follows = "nixstable";
|
||||||
};
|
};
|
||||||
darwin = {
|
darwin = {
|
||||||
url = "github:lnl7/nix-darwin/master";
|
url = "github:lnl7/nix-darwin/master";
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
ffmac.url = "github:bandithedoge/nixpkgs-firefox-darwin";
|
ffmac.url = "github:bandithedoge/nixpkgs-firefox-darwin";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {stable, nixunstable, agenix, home-manager, nurpkgs, self, wsl, flake-utils, ...}@inputs:
|
outputs = {nixstable, nixunstable, agenix, hm, nurpkgs, self, wsl, flake-utils, darwin, ...}@inputs:
|
||||||
let
|
let
|
||||||
pkg-sets = (
|
pkg-sets = (
|
||||||
final: prev: {
|
final: prev: {
|
||||||
@@ -41,110 +41,25 @@
|
|||||||
inputs.ffmac.overlay
|
inputs.ffmac.overlay
|
||||||
];
|
];
|
||||||
|
|
||||||
unstable = args: (machine (args // { channel = nixunstable; }));
|
|
||||||
machine = {
|
|
||||||
system ? "x86_64-linux",
|
|
||||||
name,
|
|
||||||
channel ? stable,
|
|
||||||
extraMods ? []
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
nixpkgs = channel;
|
|
||||||
in nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules = [
|
|
||||||
{ nixpkgs.overlays = overlays; }
|
|
||||||
agenix.nixosModule
|
|
||||||
./modules-all
|
|
||||||
./modules-linux
|
|
||||||
./hosts/${name}
|
|
||||||
home-manager.nixosModules.home-manager {
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.extraSpecialArgs = {
|
|
||||||
inherit nixpkgs;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
] ++ extraMods;
|
|
||||||
specialArgs = {
|
|
||||||
home-manager = inputs.home-manager;
|
|
||||||
inherit nixpkgs;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mac = {
|
|
||||||
system ? "aarch64-darwin",
|
|
||||||
name,
|
|
||||||
channel ? unstable,
|
|
||||||
extraMods ? []
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
nixpkgs = channel;
|
|
||||||
in inputs.darwin.lib.darwinSystem {
|
|
||||||
inherit system;
|
|
||||||
specialArgs = { inherit nixpkgs; };
|
|
||||||
modules = [
|
|
||||||
{ nixpkgs.overlays = overlays; }
|
|
||||||
inputs.agenix.nixosModule
|
|
||||||
./modules-all
|
|
||||||
./modules-darwin
|
|
||||||
./hosts/${name}
|
|
||||||
] ++ extraMods;
|
|
||||||
};
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = (import ./hosts { inherit nixstable nixunstable overlays wsl agenix; });
|
||||||
"2maccabees" = unstable { system = "aarch64-linux"; name = "2maccabees"; };
|
|
||||||
jude = unstable { name = "jude"; };
|
|
||||||
"icdm-root" = unstable { name = "icdm-root"; };
|
|
||||||
"linode" = machine { name = "linode"; };
|
|
||||||
"linodeeu" = machine { name = "linodeeu"; };
|
|
||||||
"lappy" = machine { name = "lappy"; };
|
|
||||||
mm = unstable { name = "mm"; };
|
|
||||||
"iso" = machine { name = "iso"; };
|
|
||||||
# nix build '.#nixosConfigurations.wsl.config.system.build.installer'
|
|
||||||
"nixos" = unstable { name = "wsl"; system = "aarch64-linux"; extraMods = [ wsl.nixosModules.wsl ]; };
|
|
||||||
# nix build '.#nixosConfigurations.wsl-aarch.config.system.build.installer'
|
|
||||||
"nixos-arm" = unstable { name = "wsl"; system = "aarch64-linux"; extraMods = [ wsl.nixosModules.wsl ]; };
|
|
||||||
};
|
|
||||||
|
|
||||||
darwinConfigurations =
|
darwinConfigurations = (import ./darwin { inherit agenix darwin nixstable nixunstable overlays; });
|
||||||
let
|
|
||||||
nixpkgs = stable {
|
|
||||||
overlays = overlays;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
"C02G48H8MD6R" = inputs.darwin.lib.darwinSystem {
|
|
||||||
system = "x86_64-darwin";
|
|
||||||
specialArgs = {
|
|
||||||
nixpkgs = stable;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
{ nixpkgs.overlays = overlays; }
|
|
||||||
inputs.agenix.nixosModule
|
|
||||||
./modules-all
|
|
||||||
./modules-darwin
|
|
||||||
./hosts/work
|
|
||||||
];
|
|
||||||
};
|
|
||||||
la23002 = mac { name = "ivr"; };
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultPackage = flake-utils.lib.eachDefaultSystemMap (system: inputs.self.homeConfigurations.gui."${system}".activationPackage);
|
defaultPackage = flake-utils.lib.eachDefaultSystemMap (system: inputs.self.homeConfigurations.gui."${system}".activationPackage);
|
||||||
|
|
||||||
homeConfigurations = (
|
homeConfigurations = (
|
||||||
import ./home {
|
import ./home {
|
||||||
inherit nixunstable agenix home-manager overlays flake-utils;
|
inherit nixunstable agenix hm overlays flake-utils;
|
||||||
nixpkgs = nixunstable;
|
nixpkgs = nixunstable;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
overlays = {
|
overlays = { default = local_overlay; };
|
||||||
default = import ./overlays;
|
|
||||||
};
|
|
||||||
modules = (import ./modules-all {}) //
|
modules = (import ./modules-all {}) //
|
||||||
(import ./modules-linux {}) //
|
(import ./modules-linux {}) //
|
||||||
(import ./modules-darwin {});
|
(import ./modules-darwin {});
|
||||||
packages = import ./overlays/packages.nix { pkgs = stable; };
|
packages = import ./overlays/packages.nix { pkgs = nixstable; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
overlays,
|
overlays,
|
||||||
home-manager,
|
hm,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
@@ -33,7 +33,7 @@ let
|
|||||||
config.xdg.configHome = configDir;
|
config.xdg.configHome = configDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
in home-manager.lib.homeManagerConfiguration rec {
|
in hm.lib.homeManagerConfiguration rec {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
(import ./home.nix {
|
(import ./home.nix {
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
{ nixstable, nixunstable, overlays, wsl, agenix, ... }:
|
||||||
|
let
|
||||||
|
wsl = args: (unstable (args // { extraMods = [ wsl.nixosModules.wsl ]; }));
|
||||||
|
unstable = args: (machine (args // { channel = nixunstable; }));
|
||||||
|
machine = {
|
||||||
|
system ? "x86_64-linux",
|
||||||
|
name,
|
||||||
|
channel ? nixstable,
|
||||||
|
extraMods ? []
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
nixpkgs = channel;
|
||||||
|
in nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
{ nixpkgs.overlays = overlays; }
|
||||||
|
agenix.nixosModule
|
||||||
|
../modules-all
|
||||||
|
../modules-linux
|
||||||
|
./${name}
|
||||||
|
] ++ extraMods;
|
||||||
|
specialArgs = { inherit nixpkgs; };
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
"2maccabees" = unstable { system = "aarch64-linux"; name = "2maccabees"; };
|
||||||
|
jude = unstable { name = "jude"; };
|
||||||
|
icdm-root = unstable { name = "icdm-root"; };
|
||||||
|
linode = machine { name = "linode"; };
|
||||||
|
linodeeu = machine { name = "linodeeu"; };
|
||||||
|
lappy = machine { name = "lappy"; };
|
||||||
|
mm = unstable { name = "mm"; };
|
||||||
|
iso = machine { name = "iso"; };
|
||||||
|
# nix build '.#nixosConfigurations.wsl.config.system.build.installer'
|
||||||
|
nixos = wsl { name = "wsl"; system = "aarch64-linux"; };
|
||||||
|
# nix build '.#nixosConfigurations.wsl-aarch.config.system.build.installer'
|
||||||
|
nixos-arm = wsl { name = "wsl"; system = "aarch64-linux"; };
|
||||||
|
}
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
local_overlay = import ./overlays;
|
|
||||||
in {
|
|
||||||
makeMachine =
|
|
||||||
{system, name, pkgs,
|
|
||||||
agenix ? import <agenix>,
|
|
||||||
home-manager ? import <home-manager>}:
|
|
||||||
let
|
|
||||||
mods = hostname: [
|
|
||||||
agenix.nixosModule
|
|
||||||
./modules-all
|
|
||||||
./modules-linux
|
|
||||||
./hosts/${hostname}
|
|
||||||
home-manager.nixosModules.home-manager {
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.extraSpecialArgs = {
|
|
||||||
nixunstable = pkgs;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
in (pkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules = (mods name);
|
|
||||||
specialArgs = {
|
|
||||||
nixpkgs = pkgs;
|
|
||||||
agenix = agenix;
|
|
||||||
home-manager = home-manager;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user