mirror of
https://git.lgmrszd.xyz/Lgmrszd/nix-cfg.git
synced 2024-12-22 16:09:50 +01:00
flake.nix: cleanup, generalize hosts
This commit is contained in:
parent
d8b7ee6918
commit
ee29846e7a
1 changed files with 23 additions and 33 deletions
56
flake.nix
56
flake.nix
|
@ -3,9 +3,6 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
# separate inputs to lock some packages
|
||||
# fresh - mostly desktop apps
|
||||
# nixpkgs-fresh.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
|
@ -42,7 +39,6 @@
|
|||
|
||||
outputs = inputs@{
|
||||
nixpkgs,
|
||||
# nixpkgs-fresh,
|
||||
nixpkgs-stable,
|
||||
home-manager,
|
||||
sops-nix,
|
||||
|
@ -52,39 +48,41 @@
|
|||
}:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
# overlay-fresh = final: prev: {
|
||||
# fresh = import nixpkgs-fresh {
|
||||
# overlay-stable = final: prev: {
|
||||
# stable = import nixpkgs-stable {
|
||||
# inherit system;
|
||||
# config.allowUnfree = true;
|
||||
# };
|
||||
# };
|
||||
overlay-stable = final: prev: {
|
||||
stable = import nixpkgs-stable {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
};
|
||||
overlay-vaapiIntel = final: prev: {
|
||||
vaapiIntel = prev.vaapiIntel.override { enableHybridCodec = true; };
|
||||
};
|
||||
my-overlays = [
|
||||
# overlay-fresh
|
||||
# overlay-stable
|
||||
overlay-vaapiIntel
|
||||
];
|
||||
inherit (inputs.nix-cfg-extra.lib) extra-data;
|
||||
|
||||
mkHostConfig = ({ host, extraModules ? [] }:
|
||||
let
|
||||
data = import ./hosts/${host}/data // (if extra-data ? host then extra-data.host else {});
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = { inherit data; };
|
||||
modules = [
|
||||
{ nixpkgs.overlays = my-overlays; }
|
||||
./hosts/${host}/configuration.nix
|
||||
./hosts/${host}/hardware-configuration.nix
|
||||
sops-nix.nixosModules.sops
|
||||
] ++ extraModules;
|
||||
});
|
||||
in
|
||||
{
|
||||
nixosConfigurations.lgm-nixos = nixpkgs.lib.nixosSystem rec {
|
||||
inherit system;
|
||||
modules = [
|
||||
({ config, pkgs, ... }: { nixpkgs.overlays = my-overlays; })
|
||||
./hosts/laptop/configuration.nix
|
||||
./hosts/laptop/hardware-configuration.nix
|
||||
nixosConfigurations.lgm-nixos = mkHostConfig {
|
||||
host = "laptop";
|
||||
extraModules = [
|
||||
./hosts/laptop/mounts.nix
|
||||
# nix-index-database.nixosModules.nix-index
|
||||
sops-nix.nixosModules.sops
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
|
@ -93,19 +91,11 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
nixosConfigurations.lgm-vps1 = let
|
||||
data = import ./hosts/vps1/data // (if extra-data ? vps1 then extra-data.vps1 else {});
|
||||
in
|
||||
nixpkgs.lib.nixosSystem rec {
|
||||
inherit system;
|
||||
specialArgs = { inherit data; };
|
||||
modules = [
|
||||
({ config, pkgs, ... }: { nixpkgs.overlays = my-overlays; })
|
||||
nixosConfigurations.lgm-vps1 = mkHostConfig {
|
||||
host = "vps1";
|
||||
extraModules = [
|
||||
mailserver.nixosModule
|
||||
authentik-nix.nixosModules.default
|
||||
./hosts/vps1/configuration.nix
|
||||
./hosts/vps1/hardware-configuration.nix
|
||||
sops-nix.nixosModules.sops
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue