nixos/flake.nix

98 lines
2.7 KiB
Nix
Raw Normal View History

2021-12-11 14:21:48 +01:00
{
2021-12-11 14:44:46 +01:00
description = "Andreas Zweili's Nixos configuration";
inputs = {
2021-12-11 15:21:01 +01:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";
2021-12-11 14:44:46 +01:00
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
2021-12-16 20:19:21 +01:00
# look here for the hardware options https://github.com/NixOS/nixos-hardware/blob/master/flake.nix#L5
2021-12-11 15:42:32 +01:00
nixos-hardware.url = "github:nixos/nixos-hardware";
2021-12-16 20:19:21 +01:00
2021-12-11 14:44:46 +01:00
home-manager = {
2021-12-11 15:21:01 +01:00
url = "github:nix-community/home-manager/release-21.11";
2021-12-11 14:44:46 +01:00
inputs.nixpkgs.follows = "nixpkgs";
};
};
2021-12-11 15:42:32 +01:00
outputs =
2022-01-03 20:29:08 +01:00
inputs@{ self
2021-12-11 15:42:32 +01:00
, nixpkgs
, nixpkgs-unstable
, nixos-hardware
, home-manager
}:
let
system = "x86_64-linux";
username = import ./username.nix;
2021-12-11 17:20:54 +01:00
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable {
system = "x86_64-linux";
config.allowUnfree = true;
};
};
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
2021-12-11 17:20:54 +01:00
overlays = [
overlay-unstable
];
};
mkComputer = configurationNix: homeManagerRole: extraModules: nixpkgs.lib.nixosSystem {
2021-12-16 20:19:21 +01:00
inherit system pkgs;
specialArgs = { inherit system inputs; };
modules = (
[
# System configuration for this host
configurationNix
# Common configuration
./modules/common.nix
2022-01-04 21:11:13 +01:00
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${username}.imports = [ homeManagerRole ];
2022-01-04 21:11:13 +01:00
}
] ++ extraModules
);
2021-12-16 16:09:50 +01:00
};
in
{
nixosConfigurations = {
2022-01-03 20:29:08 +01:00
gwyn = mkComputer
./systems/gwyn/configuration.nix
./home-manager/desktop.nix
2022-01-03 20:29:08 +01:00
[
nixos-hardware.nixosModules.dell-precision-5530
nixos-hardware.nixosModules.common-gpu-nvidia
2022-01-03 20:29:08 +01:00
./hardware/bluetooth
./hardware/nvidia
./modules/desktop.nix
];
2022-01-03 20:11:17 +01:00
staubfinger = mkComputer
./systems/staubfinger/configuration.nix
./home-manager/desktop.nix
2022-01-03 20:11:17 +01:00
[
nixos-hardware.nixosModules.common-pc-laptop
nixos-hardware.nixosModules.common-pc-laptop-ssd
2022-01-03 20:29:08 +01:00
./hardware/bluetooth
./modules/desktop.nix
];
2022-01-03 20:29:08 +01:00
nixos-vm = mkComputer
./systems/vm/configuration.nix
./home-manager/desktop.nix
[];
nixos-test-vm = mkComputer
2022-01-01 15:26:53 +01:00
./systems/proxmox-vm/configuration.nix
2022-01-04 21:11:13 +01:00
./home-manager/headless.nix
[
./modules/code-server
2022-01-03 20:29:08 +01:00
./modules/docker.nix
2022-01-04 21:11:13 +01:00
];
2022-01-01 15:26:53 +01:00
};
2021-12-11 15:21:01 +01:00
};
2021-12-11 14:21:48 +01:00
}