Compare commits
3 commits
main
...
flake-part
Author | SHA1 | Date | |
---|---|---|---|
a8e19d23b4 | |||
5e550368b1 | |||
1bcf87a248 |
4 changed files with 218 additions and 38 deletions
49
flake.lock
49
flake.lock
|
@ -168,6 +168,24 @@
|
|||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738453229,
|
||||
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"neovim-overlay",
|
||||
|
@ -188,7 +206,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"flake-parts_3": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"neovim-overlay",
|
||||
|
@ -209,9 +227,9 @@
|
|||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"flake-parts_3": {
|
||||
"flake-parts_4": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
"nixpkgs-lib": "nixpkgs-lib_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738453229,
|
||||
|
@ -227,9 +245,9 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_4": {
|
||||
"flake-parts_5": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib_2"
|
||||
"nixpkgs-lib": "nixpkgs-lib_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733312601,
|
||||
|
@ -339,7 +357,7 @@
|
|||
},
|
||||
"hercules-ci-effects": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_2",
|
||||
"flake-parts": "flake-parts_3",
|
||||
"nixpkgs": [
|
||||
"neovim-overlay",
|
||||
"nixpkgs"
|
||||
|
@ -460,7 +478,7 @@
|
|||
"neovim-overlay": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-parts": "flake-parts",
|
||||
"flake-parts": "flake-parts_2",
|
||||
"git-hooks": "git-hooks",
|
||||
"hercules-ci-effects": "hercules-ci-effects",
|
||||
"neovim-src": "neovim-src",
|
||||
|
@ -599,7 +617,7 @@
|
|||
},
|
||||
"nix-gaming": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_3",
|
||||
"flake-parts": "flake-parts_4",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
|
@ -668,6 +686,18 @@
|
|||
}
|
||||
},
|
||||
"nixpkgs-lib_2": {
|
||||
"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-lib_3": {
|
||||
"locked": {
|
||||
"lastModified": 1733096140,
|
||||
"narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=",
|
||||
|
@ -749,6 +779,7 @@
|
|||
"deploy-rs": "deploy-rs",
|
||||
"dunst-theme": "dunst-theme",
|
||||
"fish_theme": "fish_theme",
|
||||
"flake-parts": "flake-parts",
|
||||
"home-manager": "home-manager_2",
|
||||
"lix-module": "lix-module",
|
||||
"neovim-overlay": "neovim-overlay",
|
||||
|
@ -927,7 +958,7 @@
|
|||
},
|
||||
"zdwl": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_4",
|
||||
"flake-parts": "flake-parts_5",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
|
|
69
flake.nix
69
flake.nix
|
@ -24,38 +24,55 @@
|
|||
umu = { url = "github:Open-Wine-Components/umu-launcher?dir=packaging/nix"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
|
||||
deploy-rs = { url = "github:serokell/deploy-rs"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs, deploy-rs, ... }@inputs:
|
||||
let
|
||||
builders = import ./builders.nix inputs;
|
||||
in
|
||||
{
|
||||
nixosConfigurations = builders.compileNixosSystems [
|
||||
{ hostname = "snowhawk"; }
|
||||
];
|
||||
outputs = inputs@{ flake-parts, deploy-rs, nixpkgs, self, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
imports = [ ./flakeModules/builders ];
|
||||
|
||||
darwinConfigurations = builders.compileDarwinSystems [
|
||||
{ hostname = "lynx"; }
|
||||
];
|
||||
builders = {
|
||||
configurations.nixos = [
|
||||
{ hostname = "snowhawk"; }
|
||||
];
|
||||
|
||||
homeConfigurations = builders.compileHomes [
|
||||
{ user = "zynh"; hostname = "msiserver"; }
|
||||
{ user = "val"; hostname = "caveserver"; }
|
||||
{ user = "ravenshade"; hostname = "permafrost"; }
|
||||
];
|
||||
configurations.darwin = [
|
||||
{ hostname = "lynx"; }
|
||||
];
|
||||
|
||||
deploy =
|
||||
let homeConfigPath = username: deploy-rs.lib.x86_64-linux.activate.home-manager self.homeConfigurations.${username};
|
||||
in {
|
||||
sshUser = "ravenshade";
|
||||
nodes.permafrost = {
|
||||
hostname = "permafrost";
|
||||
profiles.home.path = homeConfigPath "ravenshade@permafrost";
|
||||
};
|
||||
configurations.home = [
|
||||
{ user = "zynh"; hostname = "msiserver"; }
|
||||
{ user = "val"; hostname = "caveserver"; }
|
||||
{ user = "ravenshade"; hostname = "permafrost"; }
|
||||
];
|
||||
|
||||
nixosModules = [
|
||||
inputs.home-manager.nixosModules.default
|
||||
inputs.chaotic.nixosModules.default
|
||||
inputs.niri.nixosModules.niri
|
||||
];
|
||||
|
||||
homeModules = [
|
||||
inputs.chaotic.homeManagerModules.default
|
||||
];
|
||||
};
|
||||
|
||||
flake =
|
||||
{
|
||||
deploy =
|
||||
let homeConfigPath = username: deploy-rs.lib.x86_64-linux.activate.home-manager self.homeConfigurations.${username};
|
||||
in {
|
||||
sshUser = "ravenshade";
|
||||
nodes.permafrost = {
|
||||
hostname = "permafrost";
|
||||
profiles.home.path = homeConfigPath "ravenshade@permafrost";
|
||||
};
|
||||
};
|
||||
|
||||
overlays.default = import ./pkgs;
|
||||
};
|
||||
|
||||
overlays.default = import ./pkgs;
|
||||
systems = [ ];
|
||||
};
|
||||
}
|
||||
|
|
135
flakeModules/builders/default.nix
Normal file
135
flakeModules/builders/default.nix
Normal file
|
@ -0,0 +1,135 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
options.builders =
|
||||
let
|
||||
inherit (lib) mkOption;
|
||||
inherit (lib.types) listOf deferredModule submodule;
|
||||
in
|
||||
{
|
||||
nixosModules = mkOption {
|
||||
type = listOf deferredModule;
|
||||
default = [ ];
|
||||
description = ''
|
||||
nixos modules to be used by all nixosConfigurations
|
||||
'';
|
||||
};
|
||||
|
||||
darwinModules = mkOption {
|
||||
type = listOf deferredModule;
|
||||
default = [ ];
|
||||
description = ''
|
||||
nix-darwin modules to be used by all darwinConfigurations
|
||||
'';
|
||||
};
|
||||
|
||||
homeModules = mkOption {
|
||||
type = listOf deferredModule;
|
||||
default = [ ];
|
||||
description = ''
|
||||
home-manager modules to be used by all homeConfigurations
|
||||
'';
|
||||
};
|
||||
|
||||
configurations = mkOption {
|
||||
type = submodule {
|
||||
options = {
|
||||
nixos = mkOption {
|
||||
type = listOf (submodule {
|
||||
options = {
|
||||
hostname = mkOption {
|
||||
type = lib.types.str;
|
||||
example = "snowhawk";
|
||||
description = ''
|
||||
nixos configuration hostname
|
||||
'';
|
||||
};
|
||||
|
||||
system = mkOption {
|
||||
type = lib.types.str;
|
||||
default = "x86_64-linux";
|
||||
example = "aarch64-linux";
|
||||
description = ''
|
||||
nixos configuration architecture
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
darwin = mkOption {
|
||||
type = listOf (submodule {
|
||||
options = {
|
||||
hostname = mkOption {
|
||||
type = lib.types.str;
|
||||
example = "lynx";
|
||||
description = ''
|
||||
nix-darwin configuration hostname
|
||||
'';
|
||||
};
|
||||
|
||||
system = mkOption {
|
||||
type = lib.types.str;
|
||||
default = "aarch64-darwin";
|
||||
example = "x86_64-darwin";
|
||||
description = ''
|
||||
nix-darwin configuration architecture
|
||||
|
||||
Note: default is aarch64-darwin not x86_64-darwin
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
home = mkOption {
|
||||
type = listOf (submodule {
|
||||
options = {
|
||||
user = mkOption {
|
||||
type = lib.types.str;
|
||||
example = "ravenshade";
|
||||
description = ''
|
||||
home-manager configuration architecture
|
||||
'';
|
||||
};
|
||||
|
||||
system = mkOption {
|
||||
type = lib.types.str;
|
||||
default = "x86_64-linux";
|
||||
example = "aarch64-darwin";
|
||||
description = ''
|
||||
home-manager configuration architecture
|
||||
'';
|
||||
};
|
||||
|
||||
hostname = lib.types.nullOr (mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
example = "permafrost";
|
||||
description = ''
|
||||
home-manager configuration hostname
|
||||
|
||||
Note: one of `hostname` or `configHostname` must be defined
|
||||
'';
|
||||
});
|
||||
|
||||
configHostname = lib.types.nullOr (mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
example = "permafrost";
|
||||
description = ''
|
||||
home-manager configuration hostname
|
||||
|
||||
Note: one of `hostname` or `configHostname` must be defined
|
||||
'';
|
||||
});
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = { };
|
||||
}
|
|
@ -75,8 +75,6 @@ rec {
|
|||
./hosts/${hostname}/hardware-configuration.nix
|
||||
./hosts/${hostname}/configuration.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
inputs.chaotic.nixosModules.default
|
||||
inputs.niri.nixosModules.niri
|
||||
{
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs self pkgs;
|
||||
|
@ -100,7 +98,6 @@ rec {
|
|||
extraSpecialArgs = { inherit inputs self; };
|
||||
|
||||
modules = [
|
||||
inputs.chaotic.homeManagerModules.default
|
||||
./hosts/${configHost}/home.nix
|
||||
];
|
||||
});
|
Loading…
Reference in a new issue