dotfiles/flake.nix

122 lines
5.6 KiB
Nix
Raw Normal View History

2024-05-31 12:41:57 +02:00
{
2024-09-13 10:46:49 +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;
};
split-monitor-workspaces = {
type = "git";
url = "https://github.com/Duckonaut/split-monitor-workspaces";
inputs.hyprland.follows = "hyprland";
ref = "fix/hyprutils";
};
nur.url = "github:nix-community/NUR";
ags.url = "github:Aylur/ags";
fzgo.url = "git+https://git.thomasave.be/thomasave/fzgo.git";
2024-05-31 12:41:57 +02:00
};
2024-09-13 10:46:49 +02:00
outputs = { nixpkgs, home-manager, nur, ... }@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
commonModules = host: user: [
./hosts/${host}/hardware-configuration.nix
2024-10-18 13:01:38 +02:00
{ nixpkgs.overlays = [ # see https://nixpk.gs/pr-tracker.html?pr=348887
nur.overlay
(final: prev: {
cliphist = prev.cliphist.overrideAttrs (_old: {
src = final.fetchFromGitHub {
owner = "sentriz";
repo = "cliphist";
rev = "c49dcd26168f704324d90d23b9381f39c30572bd";
sha256 = "sha256-2mn55DeF8Yxq5jwQAjAcvZAwAg+pZ4BkEitP6S2N0HY=";
};
vendorHash = "sha256-M5n7/QWQ5POWE4hSCMa0+GOVhEDCOILYqkSYIGoy/l0=";
});
})
]; }
2024-09-13 10:46:49 +02:00
{
nixpkgs.config.allowUnfree = true;
networking.hostName = host;
boot.loader.systemd-boot.enable = true;
time.timeZone = "Europe/Brussels";
2024-06-02 14:02:14 +02:00
2024-09-13 10:46:49 +02:00
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
};
nix.settings = {
substituters = [
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
"https://cuda-maintainers.cachix.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
experimental-features = [ "nix-command" "flakes" ];
trusted-users = [ "root" user ];
auto-optimise-store = true;
};
2024-06-03 02:00:07 +02:00
2024-09-13 10:46:49 +02:00
nix.gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 2d";
};
2024-06-02 14:02:14 +02:00
2024-09-13 10:46:49 +02:00
users.users.${user} = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAa3tMzSCRuprEACrBsKI0F/o73o6J9L1qR3TaZn/N8 user@Kell"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIByLwLAdJbmoDV5sx4hg5NbzKbOh1GmWEhDOUJ1GQBhK user@Riva"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBxMq4kubz4wWr4S8xU3GRkPcn6XRS3y7IP+qylN5QAp user@Aloria"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHtzTFdvLEvXpv69qAWLTipl4hgsKgRrRrWJRecsFthG user@Arch"
"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-02 14:02:14 +02:00
2024-09-13 10:46:49 +02:00
system.stateVersion = "23.11";
environment.sessionVariables.NIXOS_OZONE_WL = "1"; # hint electron apps to use wayland:
}
home-manager.nixosModules.home-manager
{
home-manager = {
extraSpecialArgs = {
inherit inputs;
}; # allows access to flake inputs in hm modules
useGlobalPkgs = true;
useUserPackages = true;
users.${user} = { imports = [ ./home/${host}.nix ]; };
};
}
./hosts/${host}
];
mkSystem = host: cfg:
nixpkgs.lib.nixosSystem {
system = cfg.system or "x86_64-linux";
modules = (commonModules host cfg.user) ++ (cfg.modules or [ ]);
specialArgs = inputs;
};
systems = {
Riva = { user = "user"; };
Kell = { user = "user"; };
Aloria = { user = "user"; };
};
in
{ nixosConfigurations = nixpkgs.lib.mapAttrs mkSystem systems; };
2024-05-31 12:41:57 +02:00
}