151 lines
4.5 KiB
Nix
151 lines
4.5 KiB
Nix
{
|
||
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;
|
||
};
|
||
waybar = {
|
||
type = "git";
|
||
url = "https://github.com/thomasave/Waybar";
|
||
submodules = true;
|
||
};
|
||
split-monitor-workspaces = {
|
||
url = "github:Duckonaut/split-monitor-workspaces";
|
||
inputs.hyprland.follows = "hyprland";
|
||
};
|
||
firefox-addons = {
|
||
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
|
||
inputs.nixpkgs.follows = "nixpkgs";
|
||
};
|
||
};
|
||
|
||
outputs =
|
||
{ self
|
||
, nixpkgs
|
||
, home-manager
|
||
, split-monitor-workspaces
|
||
, ...
|
||
}@inputs:
|
||
let
|
||
system = "x86_64-linux";
|
||
pkgs = nixpkgs.legacyPackages.${system};
|
||
commonModules = host: user: [
|
||
./hosts/${host}/hardware-configuration.nix
|
||
{
|
||
networking.hostName = host;
|
||
boot.loader.systemd-boot.enable = true;
|
||
boot.loader.efi.canTouchEfiVariables = true;
|
||
time.timeZone = "Europe/Brussels";
|
||
|
||
nix.settings = {
|
||
substituters = [ "https://hyprland.cachix.org" ];
|
||
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
|
||
experimental-features = [ "nix-command" "flakes" ];
|
||
};
|
||
|
||
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";
|
||
};
|
||
default_session = initial_session;
|
||
};
|
||
};
|
||
|
||
security.rtkit.enable = true;
|
||
services.pipewire = {
|
||
enable = true;
|
||
alsa.enable = true;
|
||
alsa.support32Bit = true;
|
||
pulse.enable = true;
|
||
jack.enable = true;
|
||
};
|
||
|
||
users.users.${user} = {
|
||
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;
|
||
};
|
||
|
||
|
||
environment.systemPackages = with pkgs; [
|
||
wget
|
||
curl
|
||
git
|
||
];
|
||
|
||
services.openssh = {
|
||
enable = true;
|
||
settings = {
|
||
PermitRootLogin = "no";
|
||
PasswordAuthentication = false;
|
||
};
|
||
};
|
||
|
||
networking.firewall.enable = false;
|
||
system.stateVersion = "23.11";
|
||
environment.sessionVariables.NIXOS_OZONE_WL = "1"; #hint electron apps to use wayland:
|
||
|
||
fonts.packages = with pkgs; [
|
||
noto-fonts
|
||
noto-fonts-cjk
|
||
noto-fonts-emoji
|
||
iosevka
|
||
nerdfonts
|
||
];
|
||
|
||
}
|
||
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 = {
|
||
nixos = {
|
||
user = "user";
|
||
};
|
||
Kell = {
|
||
user = "user";
|
||
};
|
||
};
|
||
in
|
||
{
|
||
nixosConfigurations = nixpkgs.lib.mapAttrs mkSystem systems;
|
||
};
|
||
}
|