install optnix

This commit is contained in:
Khaïs COLIN 2025-10-14 13:29:25 +02:00
parent 16d4b5bef4
commit 994470d0b4
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
3 changed files with 186 additions and 4 deletions

View file

@ -1,8 +1,17 @@
{ {
config,
options,
pkgs, pkgs,
pkgs-unstable, pkgs-unstable,
optnix,
home-manager,
... ...
}: { }: let
optnixLib = optnix.mkLib pkgs;
in {
imports = [
optnix.nixosModules.optnix
];
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.systemd-boot.memtest86.enable = true; boot.loader.systemd-boot.memtest86.enable = true;
@ -68,6 +77,30 @@
# does this add river to sddm menu? # does this add river to sddm menu?
programs.river.enable = true; programs.river.enable = true;
programs.optnix = {
enable = true;
settings = {
scopes = {
home-manager = {
description = "home-manager Configuration for the local machine";
options-list-file = optnixLib.hm.mkOptionsListFromHMSource {
inherit home-manager;
};
evaluator = "nix eval ~/src/nix#nixosConfigurations.${config.networking.hostName}.config.home-manager.users.khais.{{ .Option }}";
};
nixos = {
description = "NixOS Configuration for the local machine";
options-list-file =
optnixLib.mkOptionsList
{
inherit options;
};
evaluator = "nix eval ~/src/nix#nixosConfigurations.${config.networking.hostName}.config.{{ .Option }}";
};
};
};
};
# needed to set here to have correct permissions # needed to set here to have correct permissions
programs.k3b.enable = true; programs.k3b.enable = true;

149
flake.lock generated
View file

@ -233,6 +233,22 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
} }
}, },
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
@ -346,6 +362,24 @@
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_3"
}, },
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_5": {
"inputs": {
"systems": "systems_4"
},
"locked": { "locked": {
"lastModified": 1726560853, "lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
@ -594,6 +628,27 @@
"type": "github" "type": "github"
} }
}, },
"nix-options-doc": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_7",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1742115705,
"narHash": "sha256-RfXwJPWBoWswIU68+y/XZfTWtFHd/fK14bKvOlRmfPo=",
"owner": "Thunderbottom",
"repo": "nix-options-doc",
"rev": "2caa4b5756a8666d65d70122f413e295f56886e7",
"type": "github"
},
"original": {
"owner": "Thunderbottom",
"ref": "v0.2.0",
"repo": "nix-options-doc",
"type": "github"
}
},
"nixos-06cb-009a-fingerprint-sensor": { "nixos-06cb-009a-fingerprint-sensor": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
@ -750,6 +805,38 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_7": {
"locked": {
"lastModified": 1740695751,
"narHash": "sha256-D+R+kFxy1KsheiIzkkx/6L63wEHBYX21OIwlFV8JvDs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6313551cd05425cd5b3e63fe47dbc324eabb15e4",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_8": {
"locked": {
"lastModified": 1759070547,
"narHash": "sha256-JVZl8NaVRYb0+381nl7LvPE+A774/dRpif01FKLrYFQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "647e5c14cbd5067f44ac86b74f014962df460840",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": { "nixvim": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
@ -848,9 +935,29 @@
"type": "github" "type": "github"
} }
}, },
"optnix": {
"inputs": {
"flake-compat": "flake-compat_3",
"nix-options-doc": "nix-options-doc",
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1759503843,
"narHash": "sha256-kffdCHqqORAAjmWgZ0HpFxDKaPhiaHXAOsGbytpoXIs=",
"owner": "water-sucks",
"repo": "optnix",
"rev": "c23221fc3bbf5f3257649147bb35f3e8f2e3ca4f",
"type": "github"
},
"original": {
"owner": "water-sucks",
"repo": "optnix",
"type": "github"
}
},
"other-transcode": { "other-transcode": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_5",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
@ -901,11 +1008,34 @@
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_5",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"nixvim": "nixvim", "nixvim": "nixvim",
"optnix": "optnix",
"other-transcode": "other-transcode", "other-transcode": "other-transcode",
"river-shifttags": "river-shifttags", "river-shifttags": "river-shifttags",
"stylix": "stylix" "stylix": "stylix"
} }
}, },
"rust-overlay": {
"inputs": {
"nixpkgs": [
"optnix",
"nix-options-doc",
"nixpkgs"
]
},
"locked": {
"lastModified": 1740796337,
"narHash": "sha256-FuoXrXZPoJEZQ3PF7t85tEpfBVID9JQIOnVKMNfTAb0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "bbac9527bc6b28b6330b13043d0e76eac11720dc",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"stylix": { "stylix": {
"inputs": { "inputs": {
"base16": "base16", "base16": "base16",
@ -919,7 +1049,7 @@
"nixpkgs" "nixpkgs"
], ],
"nur": "nur", "nur": "nur",
"systems": "systems_4", "systems": "systems_5",
"tinted-foot": "tinted-foot", "tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty", "tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes", "tinted-schemes": "tinted-schemes",
@ -1001,6 +1131,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tinted-foot": { "tinted-foot": {
"flake": false, "flake": false,
"locked": { "locked": {

View file

@ -49,6 +49,8 @@
mms.url = "github:mkaito/nixos-modded-minecraft-servers"; mms.url = "github:mkaito/nixos-modded-minecraft-servers";
copyparty.url = "github:9001/copyparty"; copyparty.url = "github:9001/copyparty";
optnix.url = "github:water-sucks/optnix";
}; };
outputs = { outputs = {
nixpkgs, nixpkgs,
@ -64,6 +66,7 @@
cassowary, cassowary,
mms, mms,
copyparty, copyparty,
optnix,
... ...
}: let }: let
system = "x86_64-linux"; system = "x86_64-linux";
@ -105,7 +108,7 @@
specialArgs = { specialArgs = {
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
breezex-cursor = breezex-cursor.packages.${system}.default; breezex-cursor = breezex-cursor.packages.${system}.default;
inherit mms; inherit optnix home-manager;
}; };
}; };
nixosConfigurations.t470 = nixpkgs.lib.nixosSystem { nixosConfigurations.t470 = nixpkgs.lib.nixosSystem {
@ -131,6 +134,7 @@
specialArgs = { specialArgs = {
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
breezex-cursor = breezex-cursor.packages.${system}.default; breezex-cursor = breezex-cursor.packages.${system}.default;
inherit optnix home-manager;
}; };
}; };
}; };