dotfiles/flake.nix

152 lines
4.8 KiB
Nix
Raw Normal View History

2024-05-31 12:41:57 +02:00
{
2024-06-01 16:56:07 +02:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
submodules = true;
};
2024-06-01 18:06:00 +02:00
waybar = {
type = "git";
url = "https://github.com/thomasave/Waybar";
submodules = true;
};
2024-06-01 16:56:07 +02:00
split-monitor-workspaces = {
url = "github:Duckonaut/split-monitor-workspaces";
inputs.hyprland.follows = "hyprland";
2024-05-31 12:41:57 +02:00
};
2024-06-03 00:06:57 +02:00
nur.url = "github:nix-community/NUR";
2024-06-01 16:56:07 +02:00
};
2024-05-31 12:41:57 +02:00
2024-06-04 22:27:59 +02:00
outputs = { nixpkgs, home-manager, nur, ... }@inputs:
2024-06-01 16:56:07 +02:00
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
2024-06-02 14:38:25 +02:00
commonModules = host: user: [
./hosts/${host}/hardware-configuration.nix
2024-06-03 00:06:57 +02:00
{ nixpkgs.overlays = [ nur.overlay ]; }
2024-06-02 14:02:14 +02:00
{
2024-06-04 01:49:00 +02:00
hardware.opengl = {
2024-06-04 16:16:30 +02:00
enable = true;
driSupport = true;
2024-06-04 01:49:00 +02:00
};
2024-06-02 14:38:25 +02:00
networking.hostName = host;
2024-06-03 02:00:07 +02:00
boot.loader.systemd-boot = {
2024-06-03 16:02:50 +02:00
enable = true;
memtest86.enable = true;
netbootxyz.enable = true;
2024-06-03 02:00:07 +02:00
};
boot.loader.timeout = 1;
2024-06-02 14:02:14 +02:00
boot.loader.efi.canTouchEfiVariables = true;
time.timeZone = "Europe/Brussels";
nix.settings = {
substituters = [ "https://hyprland.cachix.org" ];
2024-06-03 16:02:50 +02:00
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
2024-06-02 14:02:14 +02:00
experimental-features = [ "nix-command" "flakes" ];
2024-06-04 16:16:30 +02:00
trusted-users = [ "root" "user" ];
2024-06-03 02:00:07 +02:00
auto-optimise-store = true;
};
nix.gc = {
2024-06-03 16:02:50 +02:00
automatic = true;
dates = "daily";
options = "--delete-older-than 2d";
2024-06-02 14:02:14 +02:00
};
programs.zsh.enable = true;
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
};
services.greetd = {
enable = true;
settings = rec {
initial_session = {
command = "Hyprland";
user = "user";
2024-06-01 16:56:07 +02:00
};
2024-06-02 14:02:14 +02:00
default_session = initial_session;
};
};
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
2024-06-02 14:17:07 +02:00
users.users.${user} = {
2024-06-02 14:02:14 +02:00
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAa3tMzSCRuprEACrBsKI0F/o73o6J9L1qR3TaZn/N8 user@Kell"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBxMq4kubz4wWr4S8xU3GRkPcn6XRS3y7IP+qylN5QAp user@Aloria"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHtzTFdvLEvXpv69qAWLTipl4hgsKgRrRrWJRecsFthG user@Riva"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOxtJRtlAphl8euicVUR/6C7o+tyhpYmcbMBLHnldEIX server@mallorea"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILazQU/Y9I5PkMZoG/Lzc6mDR7s+aRHzqJoFUhYSse4P PocoF1"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFoUYcVMsDw6tmjfdOuQkwaXx8fohKJs/6/5HoLzTP6x Tablet"
];
shell = pkgs.zsh;
};
2024-06-03 16:02:50 +02:00
environment.systemPackages = with pkgs; [ wget curl git ];
2024-06-02 14:02:14 +02:00
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
networking.firewall.enable = false;
system.stateVersion = "23.11";
2024-06-03 16:02:50 +02:00
environment.sessionVariables.NIXOS_OZONE_WL =
"1"; # hint electron apps to use wayland:
2024-06-02 14:02:14 +02:00
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
iosevka
nerdfonts
2024-06-01 16:56:07 +02:00
];
2024-06-02 14:02:14 +02:00
}
home-manager.nixosModules.home-manager
{
home-manager = {
2024-06-03 16:02:50 +02:00
extraSpecialArgs = {
inherit inputs;
}; # allows access to flake inputs in hm modules
2024-06-02 14:02:14 +02:00
useGlobalPkgs = true;
useUserPackages = true;
2024-06-03 16:02:50 +02:00
users.${user} = { imports = [ ./home/${host}.nix ]; };
2024-06-02 14:02:14 +02:00
};
}
2024-06-02 14:38:25 +02:00
./hosts/${host}
2024-06-02 14:02:14 +02:00
];
2024-06-03 16:02:50 +02:00
mkSystem = host: cfg:
nixpkgs.lib.nixosSystem {
system = cfg.system or "x86_64-linux";
modules = (commonModules host cfg.user) ++ (cfg.modules or [ ]);
specialArgs = inputs;
2024-06-02 16:36:56 +02:00
};
2024-06-03 16:02:50 +02:00
systems = {
nixos = { user = "user"; };
Kell = { user = "user"; };
2024-06-01 16:56:07 +02:00
};
2024-06-03 16:02:50 +02:00
in { nixosConfigurations = nixpkgs.lib.mapAttrs mkSystem systems; };
2024-05-31 12:41:57 +02:00
}