Compare commits
No commits in common. "ab627ac91948f4ca64cf78feef13e312d2d4084d" and "021dadfed8ec76864248f69e6d30af4db9cf4969" have entirely different histories.
ab627ac919
...
021dadfed8
8 changed files with 93 additions and 28 deletions
16
flake.lock
generated
16
flake.lock
generated
|
@ -337,21 +337,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"manifest": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1752588656,
|
|
||||||
"narHash": "sha256-clKPzQ43eDpukeiGHzXmd1hGb2s4N+MWXAzQ5u5+pHQ=",
|
|
||||||
"owner": "rrvsh",
|
|
||||||
"repo": "manifest",
|
|
||||||
"rev": "365902fba994f30469298dee0c98a5fc0f41ec38",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "rrvsh",
|
|
||||||
"repo": "manifest",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nix-darwin": {
|
"nix-darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -503,7 +488,6 @@
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
"import-tree": "import-tree",
|
"import-tree": "import-tree",
|
||||||
"make-shell": "make-shell",
|
"make-shell": "make-shell",
|
||||||
"manifest": "manifest",
|
|
||||||
"nix-darwin": "nix-darwin",
|
"nix-darwin": "nix-darwin",
|
||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
|
|
@ -71,8 +71,6 @@
|
||||||
files.url = "github:mightyiam/files";
|
files.url = "github:mightyiam/files";
|
||||||
# text.nix lets us easily define markdown text to pass to files
|
# text.nix lets us easily define markdown text to pass to files
|
||||||
text.url = "github:rrvsh/text.nix";
|
text.url = "github:rrvsh/text.nix";
|
||||||
# manifest lets us define all hosts in one file
|
|
||||||
manifest.url = "github:rrvsh/manifest";
|
|
||||||
# make-shells.<name> creates devShells and checks
|
# make-shells.<name> creates devShells and checks
|
||||||
make-shell = {
|
make-shell = {
|
||||||
url = "github:nicknovitski/make-shell";
|
url = "github:nicknovitski/make-shell";
|
||||||
|
|
3
nix/flake-parts/debug.nix
Normal file
3
nix/flake-parts/debug.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
debug = true;
|
||||||
|
}
|
|
@ -1,10 +0,0 @@
|
||||||
{ inputs, ... }:
|
|
||||||
{
|
|
||||||
debug = true;
|
|
||||||
imports = [
|
|
||||||
inputs.make-shell.flakeModules.default
|
|
||||||
inputs.manifest.flakeModules.default
|
|
||||||
inputs.flake-parts.flakeModules.modules
|
|
||||||
inputs.text.flakeModules.default
|
|
||||||
];
|
|
||||||
}
|
|
5
nix/flake-parts/make-shell.nix
Normal file
5
nix/flake-parts/make-shell.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
#TODO: add to readme
|
||||||
|
imports = [ inputs.make-shell.flakeModules.default ];
|
||||||
|
}
|
77
nix/flake-parts/manifest.nix
Normal file
77
nix/flake-parts/manifest.nix
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
{ lib, config, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.flake;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types)
|
||||||
|
bool
|
||||||
|
str
|
||||||
|
lazyAttrsOf
|
||||||
|
deferredModule
|
||||||
|
submodule
|
||||||
|
;
|
||||||
|
inherit (cfg.lib.options) mkStrOption;
|
||||||
|
inherit (cfg.lib.attrsets) firstAttrNameMatching;
|
||||||
|
userOpts = submodule {
|
||||||
|
options = {
|
||||||
|
primary = mkOption { type = bool; };
|
||||||
|
username = mkOption { type = str; };
|
||||||
|
name = mkOption { type = str; };
|
||||||
|
email = mkOption { type = str; };
|
||||||
|
shell = mkOption { type = str; };
|
||||||
|
pubkey = mkOption { type = str; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
monitorOpts = submodule {
|
||||||
|
options = {
|
||||||
|
id = mkStrOption "";
|
||||||
|
resolution = mkStrOption "";
|
||||||
|
refresh-rate = mkStrOption "";
|
||||||
|
scale = mkStrOption "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
hostOpts = submodule {
|
||||||
|
options = {
|
||||||
|
graphical = mkEnableOption "";
|
||||||
|
machine = {
|
||||||
|
platform = mkStrOption "";
|
||||||
|
gpu = mkStrOption "";
|
||||||
|
root.drive = mkStrOption "";
|
||||||
|
root.ephemeral = mkEnableOption "" // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
monitors = mkOption {
|
||||||
|
type = lazyAttrsOf monitorOpts;
|
||||||
|
default = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
extraCfg = mkOption {
|
||||||
|
type = deferredModule;
|
||||||
|
default = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
username = firstAttrNameMatching (_: v: v.primary or false) config.manifest.users;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.manifest = {
|
||||||
|
admin = mkOption {
|
||||||
|
type = userOpts;
|
||||||
|
readOnly = true;
|
||||||
|
};
|
||||||
|
users = mkOption {
|
||||||
|
type = lazyAttrsOf userOpts;
|
||||||
|
default = { };
|
||||||
|
};
|
||||||
|
hosts.nixos = mkOption {
|
||||||
|
type = lazyAttrsOf hostOpts;
|
||||||
|
default = { };
|
||||||
|
};
|
||||||
|
hosts.darwin = mkOption {
|
||||||
|
type = lazyAttrsOf hostOpts;
|
||||||
|
default = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config.manifest.admin = config.manifest.users.${username} // {
|
||||||
|
inherit username;
|
||||||
|
};
|
||||||
|
}
|
4
nix/flake-parts/modules.nix
Normal file
4
nix/flake-parts/modules.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
imports = [ inputs.flake-parts.flakeModules.modules ];
|
||||||
|
}
|
4
nix/flake-parts/text.nix
Normal file
4
nix/flake-parts/text.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
imports = [ inputs.text.flakeModules.default ];
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue