Restructure, remove installer

This commit is contained in:
Malte Tammena 2021-11-06 09:27:57 +01:00
parent 8c1ac06d56
commit 190959cf9e
14 changed files with 36 additions and 95 deletions

109
flake.nix
View file

@ -44,37 +44,35 @@
outputs = { self, nixpkgs, nixos-hardware, home-manager, ... }@inputs: outputs = { self, nixpkgs, nixos-hardware, home-manager, ... }@inputs:
let let
system = "x86_64-linux";
username = "malte";
publicSshKey = 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"; "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 { in rec {
nixosModules.helix-texta-hardware = { pkgs, config, lib, ... }: { nixosModules.thinkpad-p1-gen3 = { pkgs, config, lib, ... }: {
imports = [ imports = [
nixos-hardware.nixosModules.common-cpu-intel nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-gpu-nvidia nixos-hardware.nixosModules.common-gpu-nvidia
nixos-hardware.nixosModules.common-pc-laptop nixos-hardware.nixosModules.common-pc-laptop
nixos-hardware.nixosModules.common-pc-laptop-ssd nixos-hardware.nixosModules.common-pc-laptop-ssd
nixos-hardware.nixosModules.common-pc-laptop-acpi_call nixos-hardware.nixosModules.common-pc-laptop-acpi_call
./system/helix-texta-hardware.nix ./hardware/thinkpad-p1-gen3.nix
]; ];
}; };
homeManagerConfigurations."${username}" = homeManagerConfigurations.malte =
home-manager.lib.homeManagerConfiguration { home-manager.lib.homeManagerConfiguration {
inherit system username; system = "x86_64-linux";
username = "malte";
configuration = ./malte/home.nix; configuration = ./malte/home.nix;
homeDirectory = "/home/${username}"; homeDirectory = "/home/malte";
}; };
nixosModules.home-manager = { pkgs, ... }: { nixosModules.home-manager = { pkgs, ... }: {
home-manager.verbose = true; home-manager.verbose = true;
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users."${username}".imports = [ ./malte/home.nix ]; home-manager.users.malte.imports = [ ./malte/home.nix ];
}; };
# Necessary for flakes to work # Necessary for flakes to work
@ -87,11 +85,11 @@
}; };
# Some basics that every machine should have # Some basics that every machine should have
nixosModules.basics = { pkgs, ... }: { nixosModules.x86_64-linux-basics = { pkgs, ... }: {
imports = [ imports = [
inputs.custom-udev-rules.nixosModule inputs.custom-udev-rules.nixosModule
self.nixosModules.nixUnstable self.nixosModules.nixUnstable
./system/modules/neovim.nix ./modules/neovim.nix
]; ];
# Basic system things # Basic system things
system.configurationRevision = pkgs.lib.mkIf (self ? rev) self.rev; system.configurationRevision = pkgs.lib.mkIf (self ? rev) self.rev;
@ -119,20 +117,19 @@
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: { (self: super: {
# Add a meta package containing packages from master # Add a meta package containing packages from master
bleeding = inputs.nixpkgs-master.legacyPackages.${system}; bleeding = inputs.nixpkgs-master.legacyPackages.x86_64-linux;
# Add FiraCode as a package, but use NerdFonts # Add FiraCode as a package, but use NerdFonts
firaCodeNerd = super.nerdfonts.override { fonts = [ "FiraCode" ]; }; firaCodeNerd = super.nerdfonts.override { fonts = [ "FiraCode" ]; };
# TODO: Remove once khal is fixed # TODO: Remove once khal is fixed
khal = super.bleeding.khal; khal = super.bleeding.khal;
# Add the emulator # Add the emulator
"2a-emulator" = "2a-emulator" =
inputs.emulator-2a.packages."${system}"."2a-emulator"; inputs.emulator-2a.packages.x86_64-linux."2a-emulator";
# Add my mensa tool # Add my mensa tool
mensa = inputs.mensa.packages."${system}".mensa; mensa = inputs.mensa.packages.x86_64-linux.mensa;
fend = inputs.fend.packages."${system}".fend; fend = inputs.fend.packages.x86_64-linux.fend;
}) })
# Some program adjustments # Some program adjustments
(import ./overlays/logisim.nix)
(import ./overlays/cataclysm-dda.nix) (import ./overlays/cataclysm-dda.nix)
]; ];
}; };
@ -141,13 +138,13 @@
nixosConfigurations.helix-texta = nixpkgs.lib.nixosSystem { nixosConfigurations.helix-texta = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./system/helix-texta.nix ./hosts/helix-texta.nix
./system/light-actkbd.nix ./modules/light-actkbd.nix
./system/modules/scanner.nix ./modules/scanner.nix
self.nixosModules.helix-texta-hardware self.nixosModules.thinkpad-p1-gen3
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
self.nixosModules.home-manager self.nixosModules.home-manager
self.nixosModules.basics self.nixosModules.x86_64-linux-basics
({ pkgs, ... }: { ({ pkgs, ... }: {
nix = { nix = {
@ -155,25 +152,23 @@
binaryCachePublicKeys = [ binaryCachePublicKeys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
# ...
]; ];
binaryCaches = [ binaryCaches = [
"https://cache.nixos.org" "https://cache.nixos.org"
"https://nixpkgs-wayland.cachix.org" "https://nixpkgs-wayland.cachix.org"
# ...
]; ];
}; };
# Overwrite basics # Overwrite basics
services.openssh.enable = false; services.openssh.enable = false;
programs.mosh.enable = false; programs.mosh.enable = false;
boot.kernelPackages = pkgs.linuxPackages_latest;
# Overlays only relevant to my primary laptop
nixpkgs.overlays = [ nixpkgs.overlays = [
# Use packages from nixpkgs-wayland
inputs.nixpkgs-wayland.overlay inputs.nixpkgs-wayland.overlay
inputs.fenix.overlay inputs.fenix.overlay
(import ./overlays/sane-backends.nix) (import ./overlays/sane-backends.nix)
(import ./overlays/logisim.nix)
]; ];
}) })
]; ];
@ -183,11 +178,11 @@
nixosConfigurations.achatina-fulica = nixpkgs.lib.nixosSystem { nixosConfigurations.achatina-fulica = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
self.nixosModules.basics self.nixosModules.x86_64-linux-basics
./system/achatina-fulica.nix ./hosts/achatina-fulica.nix
./system/achatina-fulica-hardware.nix ./hardware/netcup-minimal.nix
./system/modules/nginx-reverse-proxy.nix ./modules/nginx-reverse-proxy.nix
./system/modules/radicale.nix ./modules/radicale.nix
]; ];
}; };
@ -195,11 +190,11 @@
nixosConfigurations.elysia-clarki = nixpkgs.lib.nixosSystem { nixosConfigurations.elysia-clarki = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
self.nixosModules.basics self.nixosModules.x86_64-linux-basics
./system/elysia-clarki.nix ./hosts/elysia-clarki.nix
./system/elysia-clarki-hardware.nix ./hardware/intel-nuc.nix
./system/modules/nginx-reverse-proxy.nix ./modules/nginx-reverse-proxy.nix
./system/modules/binary-cache.nix ./modules/binary-cache.nix
({ pkgs, ... }: { ({ pkgs, ... }: {
# Override kernel version for zfs # Override kernel version for zfs
@ -208,49 +203,5 @@
]; ];
}; };
# Experiments with iso generation
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;
}; };
} }

View file

@ -26,12 +26,16 @@
# Enable bluetooth # Enable bluetooth
bluetooth.enable = true; bluetooth.enable = true;
nvidia.modesetting.enable = true;
nvidia.prime = { nvidia.prime = {
nvidiaBusId = "PCI:1:0:0"; nvidiaBusId = "PCI:1:0:0";
intelBusId = "PCI:0:2:0"; intelBusId = "PCI:0:2:0";
}; };
opengl = { opengl = {
enable = true; enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
@ -46,6 +50,7 @@
}; };
services.blueman.enable = true; services.blueman.enable = true;
services.xserver.videoDrivers = lib.mkForce [ "nouveau" ];
nixpkgs.config.packageOverrides = pkgs: { nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
@ -54,7 +59,6 @@
services.fprintd.enable = true; services.fprintd.enable = true;
services.hardware.bolt.enable = true; services.hardware.bolt.enable = true;
system.fsPackages = [ pkgs.sshfs ];
fileSystems = { fileSystems = {
"/" = { "/" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d"; device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";

View file

@ -32,22 +32,9 @@ in {
hostName = "helix-texta"; hostName = "helix-texta";
# nm ftw # nm ftw
networkmanager.enable = true; networkmanager.enable = true;
# Make my server known!
hosts = {
"2a02:810a:143f:eafc:3e97:eff:fed0:e719" = [
"tammena.rocks"
"media.tammena.rocks"
"git.tammena.rocks"
"cloud.tammena.rocks"
];
};
}; };
services.xserver = { videoDrivers = lib.mkForce [ "nouveau" ]; }; system.fsPackages = [ pkgs.sshfs ];
hardware.nvidia.modesetting.enable = true;
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
hardware.opengl.enable = true;
# Pipewire for my wayland # Pipewire for my wayland
sound.enable = false; sound.enable = false;
@ -165,7 +152,6 @@ in {
virtualisation = { virtualisation = {
podman = { podman = {
enable = true; enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement # Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true; dockerCompat = true;
dockerSocket.enable = true; dockerSocket.enable = true;