1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-30 19:47:47 +00:00

Clean up flake

This commit is contained in:
RGBCube 2023-11-23 13:46:44 +03:00
parent 345217b900
commit 73ee4b2873
No known key found for this signature in database
2 changed files with 130 additions and 119 deletions

70
flake.lock generated
View file

@ -8,11 +8,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1700374854,
"narHash": "sha256-mJOk9Rg5dbh9LorTKaiXlxCpfLZju/ngSvDABPzv870=",
"lastModified": 1700720546,
"narHash": "sha256-p31fe4lp2KBCyUf58mgai1xYjMLl5S0PQiSvv9+1j/Y=",
"owner": "nix-community",
"repo": "fenix",
"rev": "95b4121cdcf9d6e91666305a1a9c57e483947e15",
"rev": "5ade7808d45671b545f3516adf61bc9a604a6246",
"type": "github"
},
"original": {
@ -21,18 +21,18 @@
"type": "github"
}
},
"home-manager": {
"homeManager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1700386809,
"narHash": "sha256-2IPxWo0Yplv+70EueZVLTwRAijax0tirYp5Jh0QV1A4=",
"lastModified": 1700695018,
"narHash": "sha256-MAiPLgBF4GLzSOlhnPCDWkWW5CDx4i7ApIYaR+TwTVg=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "9a4725afa67db35cdf7be89f30527d745194cafa",
"rev": "134deb46abd5d0889d913b8509413f6f38b0811e",
"type": "github"
},
"original": {
@ -50,11 +50,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1700397206,
"narHash": "sha256-ityVJcy3I/E8soXctwWveg58+cXOSQXhDIcU6YR2gjI=",
"lastModified": 1700696626,
"narHash": "sha256-Rr6s2HE9v0AlI630WAE+12usUJpwd3fAP6Gvk7rF5v4=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "646f4bc63861e03b01fed3833bb65d1d014e1bf3",
"rev": "e55c5a916ab942e641339471bc80b6d2efbc2044",
"type": "github"
},
"original": {
@ -106,11 +106,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1700204040,
"narHash": "sha256-xSVcS5HBYnD3LTer7Y2K8ZQCDCXMa3QUD1MzRjHzuhI=",
"lastModified": 1700390070,
"narHash": "sha256-de9KYi8rSJpqvBfNwscWdalIJXPo8NjdIZcEJum1mH0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad",
"rev": "e4ad989506ec7d71f7302cc3067abd82730a4beb",
"type": "github"
},
"original": {
@ -123,19 +123,20 @@
"root": {
"inputs": {
"fenix": "fenix",
"home-manager": "home-manager",
"homeManager": "homeManager",
"hyprland": "hyprland",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_2",
"utils": "utils"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1700247620,
"narHash": "sha256-+Xg0qZLbC9dZx0Z6JbaVHR/BklAr2I83dzKLB8r41c8=",
"lastModified": 1700642897,
"narHash": "sha256-LoyZRcl0bBuSnV9SVqrf+vUxN1u9FeYk4vgQS/kyCOI=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "255eed40c45fcf108ba844b4ad126bdc4e7a18df",
"rev": "7ceefc7ee981f7dd9de4cfdd070696e48b4ab43e",
"type": "github"
},
"original": {
@ -160,6 +161,39 @@
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"wlroots": {
"flake": false,
"locked": {

View file

@ -2,11 +2,6 @@
description = "My NixOS configurations.";
nixConfig = {
extra-experimental-features = ''
nix-command
flakes
'';
extra-substituters = ''
https://nix-community.cachix.org/
https://hyprland.cachix.org/
@ -28,6 +23,10 @@
inputs.nixpkgs.follows = "nixpkgs";
};
utils = {
url = "github:numtide/flake-utils";
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
@ -38,24 +37,14 @@
};
};
outputs = { nixpkgs, homeManager, fenix, ... } @ inputs: let
machines = [
./machines/enka
];
outputs = { nixpkgs, homeManager, utils, fenix, hyprland, ... }: utils.lib.eachDefaultSystem (system: let
lib = nixpkgs.lib;
architectures = [
"x86_64-linux"
];
lib = nixpkgs.lib // {
ulib = rec {
recursiveUpdate3 = x: y: z: lib.recursiveUpdate x (lib.recursiveUpdate y z);
};
theme = import ./themes/gruvbox.nix;
# GENERAL
imports = importPaths: {
imports = importPaths;
imports = paths: {
imports = paths;
};
enabled = attributes: attributes // {
@ -66,7 +55,6 @@
isNormalUser = true;
};
# SYSTEM
systemConfiguration = attributes: attributes;
systemPackages = packages: systemConfiguration {
@ -77,36 +65,18 @@
fonts.packages = fonts;
};
# HOME
homeConfiguration = userName: attributes: systemConfiguration {
home-manager.users = builtins.foldl' lib.recursiveUpdate {} (builtins.map (userName: {
${userName} = attributes;
}) (if builtins.isList userName then userName else [ userName ]));
homeConfiguration = user: attributes: systemConfiguration {
home-manager.users = builtins.foldl' lib.recursiveUpdate {} (builtins.map (user: {
${user} = attributes;
}) (if builtins.isList user then user else [ user ]));
};
homePackages = userName: packages: homeConfiguration userName {
homePackages = user: packages: homeConfiguration user {
home.packages = packages;
};
importConfiguration = configurationDirectory: hostPlatform: let
hostName = builtins.baseNameOf configurationDirectory;
pkgs = import nixpkgs {
system = hostPlatform;
config.allowUnfree = true;
overlays = [
fenix.overlays.default
];
};
hyprland = inputs.hyprland.packages.${hostPlatform}.hyprland;
arguments = {
inherit lib pkgs hyprland theme systemConfiguration systemPackages homeConfiguration systemFonts homePackages imports enabled normalUser;
};
defaultConfiguration = {
defaultConfiguration = host: ulib.systemConfiguration {
nix.gc = {
automatic = true;
dates = "daily";
@ -124,26 +94,33 @@
"flakes"
];
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
fenix.overlays.default
hyprland.overlays.default
];
environment.defaultPackages = [];
boot.tmp.cleanOnBoot = true;
networking.hostName = hostName;
networking.hostName = host;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
};
specialArgs = {
inherit ulib;
};
in {
nixosConfigurations.enka = lib.nixosSystem {
inherit specialArgs;
modules = [
homeManager.nixosModules.default
defaultConfiguration
configurationDirectory
(defaultConfiguration "enka")
./machines/enka
];
in {
nixosConfigurations.${hostName} = lib.nixosSystem {
specialArgs = arguments;
modules = modules;
};
};
in builtins.foldl' lib.recursiveUpdate {} (builtins.concatMap (architecture: builtins.map (configuration: importConfiguration configuration architecture) machines) architectures);
});
}