nixos-config/flake.nix

87 lines
2.4 KiB
Nix
Raw Normal View History

2024-07-30 22:56:44 +02:00
{
description = "Moe.OS";
2024-08-11 13:47:17 +02:00
2024-07-30 22:56:44 +02:00
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
2024-08-01 13:27:23 +02:00
jovian.url = "github:Jovian-Experiments/Jovian-NixOS/development";
2024-08-10 15:47:04 +02:00
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
2024-08-11 13:47:17 +02:00
url = "github:nix-community/plasma-manager/trunk";
2024-08-10 15:47:04 +02:00
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
2024-07-30 22:56:44 +02:00
};
2024-08-10 17:44:43 +02:00
2024-08-11 13:47:17 +02:00
outputs = { self, nixpkgs, home-manager, jovian, plasma-manager, ... }:
let
lib = nixpkgs.lib;
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
commonModules = [
home-manager.nixosModules.home-manager
2024-08-13 19:56:30 +02:00
./modules/system/boot
./modules/system/devices
./modules/system/locale
./modules/system/networking
./modules/system/nixsettings
./modules/system/shell
./modules/system/systemversion
./modules/system/upgrades
2024-08-11 13:47:17 +02:00
];
homeManagerConfig = {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.extraSpecialArgs = { inherit pkgs; };
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
};
# Host-specific configurations
hosts = {
computer-mo = {
user = "mo";
2024-08-13 19:56:30 +02:00
extraModules = [];
2024-08-11 13:47:17 +02:00
userConfig = {
isNormalUser = true;
home = "/home/mo";
shell = pkgs.zsh;
extraGroups = [ "wheel" "networkmanager" ];
};
};
steamdeck = {
user = "deck";
2024-08-13 19:56:30 +02:00
extraModules = [];
2024-08-11 13:47:17 +02:00
userConfig = {
isNormalUser = true;
home = "/home/deck";
shell = pkgs.zsh;
extraGroups = [ "wheel" "networkmanager" ];
};
};
2024-07-30 22:56:44 +02:00
};
2024-08-11 13:47:17 +02:00
in {
nixosConfigurations = lib.mapAttrs (hostName: hostConfig:
lib.nixosSystem {
specialArgs = {};
modules = commonModules ++ hostConfig.extraModules ++ [
# Users configuration
{ users.users.${hostConfig.user} = hostConfig.userConfig; }
# Home Manager user imports
{ home-manager.users.${hostConfig.user}.imports = [
];
}
homeManagerConfig
];
}
) hosts;
2024-07-30 22:56:44 +02:00
};
}