mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
module moving mostly done
This commit is contained in:
parent
a9de747c25
commit
e78a971b9b
33 changed files with 455 additions and 447 deletions
53
modules/nix.nix
Normal file
53
modules/nix.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
nix,
|
||||
unstable,
|
||||
...
|
||||
}: {
|
||||
inputs,
|
||||
lib,
|
||||
self,
|
||||
settings,
|
||||
...
|
||||
}: {
|
||||
nix = {
|
||||
# package = nix.packages.${pkgs.system}.nix;
|
||||
#automatically get registry from input flakes
|
||||
registry =
|
||||
(
|
||||
lib.attrsets.mapAttrs (
|
||||
_: value: {
|
||||
flake = value;
|
||||
}
|
||||
) (
|
||||
lib.attrsets.filterAttrs (
|
||||
_: value: (
|
||||
!(lib.attrsets.hasAttrByPath ["flake"] value) || value.flake == false
|
||||
)
|
||||
)
|
||||
inputs
|
||||
)
|
||||
// {
|
||||
nixpkgs.flake = unstable;
|
||||
system.flake = self;
|
||||
}
|
||||
)
|
||||
// {system = {flake = self;};};
|
||||
#automatically add registry entries to nixPath
|
||||
nixPath = (lib.mapAttrsToList (name: value: name + "=" + value) inputs) ++ ["system=${self}" "nixpkgs=${unstable}"];
|
||||
settings = {
|
||||
experimental-features = ["nix-command" "flakes" "repl-flake"];
|
||||
auto-optimise-store = true;
|
||||
warn-dirty = false;
|
||||
flake-registry = builtins.toFile "empty-flake-registry.json" ''{"flakes":[],"version":2}'';
|
||||
keep-outputs = true;
|
||||
keep-derivations = true;
|
||||
trusted-users = [
|
||||
"root"
|
||||
"@wheel"
|
||||
];
|
||||
allowed-users = [
|
||||
];
|
||||
};
|
||||
};
|
||||
environment.etc."booted-system".source = self;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue