280 lines
10 KiB
Nix
280 lines
10 KiB
Nix
{
|
|
description = "Malte Tammena's system configuration";
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
inputs.nixpkgs-master.url = "github:NixOS/nixpkgs/master";
|
|
inputs.nixos-hardware.url = "github:NixOS/nixos-hardware";
|
|
inputs.nixpkgs-wayland.url = "github:colemickens/nixpkgs-wayland";
|
|
inputs.home-manager.url = "github:nix-community/home-manager";
|
|
inputs.emulator-2a.url = "github:MalteT/2a-emulator/develop";
|
|
inputs.gruvbox-material-gtk = {
|
|
url = "github:sainnhe/gruvbox-material-gtk";
|
|
flake = false;
|
|
};
|
|
inputs.rip = {
|
|
url = "github:nivekuil/rip";
|
|
flake = false;
|
|
};
|
|
inputs.sway = {
|
|
url = "github:swaywm/sway";
|
|
flake = false;
|
|
};
|
|
inputs.wlroots = {
|
|
url = "github:swaywm/wlroots";
|
|
flake = false;
|
|
};
|
|
inputs.mosh = {
|
|
url = "github:mobile-shell/mosh";
|
|
flake = false;
|
|
};
|
|
inputs."2i-emulator" = {
|
|
url = "github:klemens/2i-emulator";
|
|
flake = false;
|
|
};
|
|
inputs."cataclysm-dda" = {
|
|
url = "github:CleverRaven/Cataclysm-DDA";
|
|
flake = false;
|
|
};
|
|
|
|
outputs = { self, nixpkgs, nixos-hardware, home-manager, ... }@inputs:
|
|
let
|
|
system = "x86_64-linux";
|
|
username = "malte";
|
|
|
|
publicSshKey =
|
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDXnYMJtwgvSNpjysKzvRCjzyyQRB4yDtzynD7c5ALDZfRHvrgGQS11vk96ExClo66ll3vrFci5mBmGJf4/+yPBb3qiiovEHobjh5nIDHXYTg7tJDHivKIMQ3w8DmZwBKSLFlsH/UZe8NJVGrGRHGofWnTY/yw/FdbAkaKqvF/V+WGP7kR+dQ1pIqXXpP3phAu0WfO+E2838XxHAxLtm35GkE40GCX9dhXmjurxCeTSaJE6OYQ4/+z73fOZc1ebV/Ze6UZsGhOtzJPBIH19Ft0v9x86KoZabqgK3KDSHn9QKcM+Mm7o3tOthfQPlg1tCoxGueDJFI/0+AyjwBmQ1CUvNXpfmL4NE+6GRwRfZNsWoW0nPmC1B/c3rWk+JXYsxGQhvVeDk+1HXCFKghdPTSgpESua03A4UqLNadERYC9s2Q5TzSYQsV/8fpg4gCxlVRl/g1aUvbaCL09jmUkDJ4i36X+g8rvux5Q2CTpskLuhHeFVcC4/c1XXF+cJTwl1GjppEL0JFKgcjIwlyE8neR4PVlOq3UQqZdZEvzZigaLxtpwZMKNGhdIqS2/qqo/LlJ66/Y7TohimhsCRyHHqbf85Cha1z0Ct+9GtTdn9hpeC6Sb2Et+iN4gxdm+SWqPybZipeBL7b+ir5Ssxq1vIf/sbqKh7Kz699dwKSeRaAmJiew== openpgp:0xC43C0C72";
|
|
|
|
in rec {
|
|
|
|
nixosModules.helix-texta-i3-hardware = { pkgs, config, lib, ... }: {
|
|
imports = [
|
|
nixos-hardware.nixosModules.common-cpu-intel
|
|
nixos-hardware.nixosModules.common-gpu-nvidia
|
|
nixos-hardware.nixosModules.common-pc-laptop
|
|
nixos-hardware.nixosModules.common-pc-laptop-ssd
|
|
nixos-hardware.nixosModules.common-pc-laptop-acpi_call
|
|
./system/helix-texta-hardware.nix
|
|
|
|
({ pkgs, ... }: {
|
|
hardware.nvidia.prime.offload.enable = true;
|
|
hardware.nvidia.package =
|
|
config.boot.kernelPackages.nvidiaPackages.beta;
|
|
hardware.nvidia.modesetting.enable = true;
|
|
})
|
|
];
|
|
};
|
|
|
|
nixosModules.helix-texta-hardware = { pkgs, config, lib, ... }: {
|
|
imports = [
|
|
nixos-hardware.nixosModules.common-cpu-intel
|
|
nixos-hardware.nixosModules.common-gpu-nvidia
|
|
nixos-hardware.nixosModules.common-pc-laptop
|
|
nixos-hardware.nixosModules.common-pc-laptop-ssd
|
|
nixos-hardware.nixosModules.common-pc-laptop-acpi_call
|
|
./system/helix-texta-hardware.nix
|
|
];
|
|
};
|
|
|
|
homeManagerConfigurations."${username}" =
|
|
home-manager.lib.homeManagerConfiguration {
|
|
inherit system username;
|
|
configuration = ./malte/home.nix;
|
|
homeDirectory = "/home/${username}";
|
|
};
|
|
|
|
homeManagerConfigurations."${username}-i3" =
|
|
home-manager.lib.homeManagerConfiguration {
|
|
inherit system username;
|
|
configuration = ./malte-i3/home.nix;
|
|
homeDirectory = "/home/${username}";
|
|
};
|
|
|
|
nixosModules.home-manager = { pkgs, ... }: {
|
|
home-manager.verbose = true;
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users."${username}".imports = [ ./malte/home.nix ];
|
|
};
|
|
|
|
# Necessary for flakes to work
|
|
nixosModules.nixUnstable = { pkgs, ... }: {
|
|
nix.registry.nixpkgs.flake = nixpkgs;
|
|
nix.package = pkgs.nixUnstable;
|
|
nix.extraOptions = ''
|
|
experimental-features = nix-command flakes
|
|
'';
|
|
};
|
|
|
|
# Some basics that every machine should have
|
|
nixosModules.basics = { pkgs, ... }: {
|
|
imports = [ self.nixosModules.nixUnstable ./system/modules/neovim.nix ];
|
|
# Basic system things
|
|
system.configurationRevision = pkgs.lib.mkIf (self ? rev) self.rev;
|
|
nixpkgs.config.allowUnfree = true;
|
|
hardware.enableAllFirmware = true;
|
|
# Make sure that I can log in
|
|
users.users.root = { openssh.authorizedKeys.keys = [ publicSshKey ]; };
|
|
# Basic packages
|
|
environment.systemPackages = with pkgs; [ ];
|
|
# Enable mosh for some SSH superpower
|
|
programs.mosh.enable = pkgs.lib.mkDefault true;
|
|
services.openssh.enable = pkgs.lib.mkDefault true;
|
|
# My timezone
|
|
time.timeZone = "Europe/Berlin";
|
|
# Some boot defaults
|
|
boot.kernelPackages = pkgs.lib.mkDefault pkgs.linuxPackages_latest;
|
|
boot.loader.timeout = pkgs.lib.mkDefault 1;
|
|
boot.loader.systemd-boot.configurationLimit = 100;
|
|
# Add some useful overlays
|
|
nixpkgs.overlays = [
|
|
(self: super: {
|
|
# Add a meta package containing packages from master
|
|
bleeding = inputs.nixpkgs-master.legacyPackages.${system};
|
|
# Add FiraCode as a package, but use NerdFonts
|
|
firaCodeNerd = super.nerdfonts.override { fonts = [ "FiraCode" ]; };
|
|
# TODO: Remove once khal is fixed
|
|
khal = super.bleeding.khal;
|
|
# Add the emulator
|
|
"2a-emulator" =
|
|
inputs.emulator-2a.packages."${system}"."2a-emulator";
|
|
})
|
|
# Some program adjustments
|
|
(import ./overlays/mosh.nix)
|
|
(import ./overlays/logisim.nix)
|
|
];
|
|
};
|
|
|
|
nixosConfigurations.helix-texta = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
./system/helix-texta.nix
|
|
./system/light-actkbd.nix
|
|
./system/modules/restic.nix
|
|
self.nixosModules.helix-texta-hardware
|
|
home-manager.nixosModules.home-manager
|
|
self.nixosModules.home-manager
|
|
self.nixosModules.basics
|
|
|
|
({ pkgs, ... }: {
|
|
nix = {
|
|
# add binary caches
|
|
binaryCachePublicKeys = [
|
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
|
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
|
|
# ...
|
|
];
|
|
binaryCaches = [
|
|
"https://cache.nixos.org"
|
|
"https://nixpkgs-wayland.cachix.org"
|
|
# ...
|
|
];
|
|
};
|
|
|
|
# Overwrite basics
|
|
services.openssh.enable = false;
|
|
programs.mosh.enable = false;
|
|
boot.kernelPackages = pkgs.linuxPackages_5_12;
|
|
|
|
nixpkgs.overlays = [
|
|
# Use packages from nixpkgs-wayland
|
|
inputs.nixpkgs-wayland.overlay
|
|
];
|
|
})
|
|
];
|
|
};
|
|
|
|
nixosConfigurations.helix-texta-i3 = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
./system/helix-texta-i3.nix
|
|
./system/light-actkbd.nix
|
|
./system/modules/restic.nix
|
|
self.nixosModules.helix-texta-i3-hardware
|
|
self.nixosModules.basics
|
|
home-manager.nixosModules.home-manager
|
|
|
|
({ pkgs, ... }: {
|
|
# Home manager config
|
|
home-manager.verbose = true;
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users."${username}".imports = [ ./malte/home.nix ];
|
|
# Overwrite basics
|
|
services.openssh.enable = false;
|
|
programs.mosh.enable = false;
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
})
|
|
];
|
|
};
|
|
|
|
nixosConfigurations.achatina-fulica = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
self.nixosModules.basics
|
|
./system/achatina-fulica.nix
|
|
./system/achatina-fulica-hardware.nix
|
|
./system/modules/nginx-reverse-proxy.nix
|
|
./system/modules/radicale.nix
|
|
];
|
|
};
|
|
|
|
nixosConfigurations.elysia-clarki = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
self.nixosModules.basics
|
|
./system/elysia-clarki.nix
|
|
./system/elysia-clarki-hardware.nix
|
|
|
|
({ pkgs, ... }: {
|
|
# Override kernel version for zfs
|
|
boot.kernelPackages = pkgs.linuxPackages_5_10;
|
|
})
|
|
];
|
|
};
|
|
|
|
nixosConfigurations.installer = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-base.nix"
|
|
home-manager.nixosModules.home-manager
|
|
self.nixosModules.home-manager
|
|
self.nixosModules.basics
|
|
|
|
({ pkgs, ... }: {
|
|
#nixpkgs.config.allowBroken = true;
|
|
# Override kernel version for zfs
|
|
boot.kernelPackages = pkgs.linuxPackages_5_10;
|
|
users.users.malte = {
|
|
description = "Malte Tammena";
|
|
isNormalUser = true;
|
|
extraGroups =
|
|
[ "wheel" "networkmanager" "video" "lp" "kvm" "libvirtd" ];
|
|
# Yes, use the best, please
|
|
shell = pkgs.fish;
|
|
};
|
|
|
|
services.xserver = {
|
|
enable = true;
|
|
|
|
desktopManager = { xterm.enable = false; };
|
|
|
|
displayManager = { defaultSession = "none+i3"; };
|
|
|
|
windowManager.i3 = {
|
|
enable = true;
|
|
extraPackages = with pkgs; [
|
|
dmenu # application launcher most people use
|
|
i3status # gives you the default i3 status bar
|
|
i3lock # default i3 screen locker
|
|
i3blocks # if you are planning on using i3blocks over i3status
|
|
];
|
|
};
|
|
};
|
|
})
|
|
];
|
|
};
|
|
|
|
installer = nixosConfigurations.installer.config.system.build.isoImage;
|
|
};
|
|
}
|