mirror of
https://git.lgmrszd.xyz/Lgmrszd/nix-cfg.git
synced 2024-11-09 21:38:34 +01:00
Lgmrszd
9451fe2c8e
Flake lock file updates: • Updated input 'home-manager': 'github:nix-community/home-manager/36e2f9da91ce8b63a549a47688ae60d47c50de4b' (2024-07-03) → 'github:nix-community/home-manager/e3582e5151498bc4d757e8361431ace8529e7bb7' (2024-07-05) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/00d80d13810dbfea8ab4ed1009b09100cca86ba8' (2024-07-01) → 'github:NixOS/nixpkgs/9f4128e00b0ae8ec65918efeba59db998750ead6' (2024-07-03) • Updated input 'nixpkgs-stable': 'github:NixOS/nixpkgs/28f8f3531ebdbea069995c20bd946a295699f275' (2024-07-01) → 'github:NixOS/nixpkgs/c0d0be00d4ecc4b51d2d6948e37466194c1e6c51' (2024-07-04) • Updated input 'sops-nix': 'github:Mic92/sops-nix/a11224af8d824935f363928074b4717ca2e280db' (2024-07-01) → 'github:Mic92/sops-nix/1b11e208cee97c47677439625dc22e5289dcdead' (2024-07-05)
113 lines
3.3 KiB
Nix
113 lines
3.3 KiB
Nix
{
|
|
description = "Lgm's NixOS Flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
flake-compat.url = "github:edolstra/flake-compat";
|
|
systems.url = "github:nix-systems/default";
|
|
flake-utils = {
|
|
url = "github:numtide/flake-utils";
|
|
inputs.systems.follows = "systems";
|
|
};
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/master";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.nixpkgs-stable.follows = "nixpkgs-stable";
|
|
};
|
|
mailserver = {
|
|
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master";
|
|
inputs.flake-compat.follows = "flake-compat";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
authentik-nix = {
|
|
url = "github:nix-community/authentik-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.flake-parts.follows = "flake-parts";
|
|
};
|
|
|
|
nix-cfg-extra.url = "git+https://git.lgmrszd.xyz/lgmrszd/nix-cfg-extra-public.git";
|
|
};
|
|
|
|
outputs = inputs@{
|
|
nixpkgs,
|
|
nixpkgs-stable,
|
|
home-manager,
|
|
sops-nix,
|
|
mailserver,
|
|
authentik-nix,
|
|
...
|
|
}:
|
|
let
|
|
system = "x86_64-linux";
|
|
# 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-stable
|
|
overlay-vaapiIntel
|
|
];
|
|
inherit (inputs.nix-cfg-extra.lib) extra-data;
|
|
inherit (inputs.nix-cfg-extra.lib) extra-host-modules;
|
|
inherit (inputs.nix-cfg-extra.lib) extra-host-home-modules;
|
|
|
|
mkHostConfig = ({ host, extraModules ? [], useHome ? false }:
|
|
let
|
|
# TODO: rename some of those
|
|
data = import ./hosts/${host}/data // (if extra-data ? ${host} then extra-data.${host} else {});
|
|
extra-modules = (if extra-host-modules ? ${host} then extra-host-modules.${host} else []);
|
|
extra-home-modules = (if extra-host-home-modules ? ${host} then extra-host-home-modules.${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
|
|
]
|
|
++ extra-modules
|
|
++ extraModules
|
|
++ (if !useHome then [] else [
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users.lgm = {
|
|
imports = [
|
|
./hosts/${host}/home
|
|
] ++ extra-home-modules;
|
|
};
|
|
}
|
|
])
|
|
;
|
|
});
|
|
in
|
|
{
|
|
nixosConfigurations.lgm-nixos = mkHostConfig {
|
|
host = "laptop";
|
|
useHome = true;
|
|
};
|
|
nixosConfigurations.lgm-vps1 = mkHostConfig {
|
|
host = "vps1";
|
|
extraModules = [
|
|
mailserver.nixosModule
|
|
authentik-nix.nixosModules.default
|
|
];
|
|
};
|
|
};
|
|
}
|