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:
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-hardware = { pkgs, config, lib, ... }: {
nixosModules.thinkpad-p1-gen3 = { 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
./hardware/thinkpad-p1-gen3.nix
];
};
homeManagerConfigurations."${username}" =
homeManagerConfigurations.malte =
home-manager.lib.homeManagerConfiguration {
inherit system username;
system = "x86_64-linux";
username = "malte";
configuration = ./malte/home.nix;
homeDirectory = "/home/${username}";
homeDirectory = "/home/malte";
};
nixosModules.home-manager = { pkgs, ... }: {
home-manager.verbose = true;
home-manager.useGlobalPkgs = 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
@ -87,11 +85,11 @@
};
# Some basics that every machine should have
nixosModules.basics = { pkgs, ... }: {
nixosModules.x86_64-linux-basics = { pkgs, ... }: {
imports = [
inputs.custom-udev-rules.nixosModule
self.nixosModules.nixUnstable
./system/modules/neovim.nix
./modules/neovim.nix
];
# Basic system things
system.configurationRevision = pkgs.lib.mkIf (self ? rev) self.rev;
@ -119,20 +117,19 @@
nixpkgs.overlays = [
(self: super: {
# 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
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";
inputs.emulator-2a.packages.x86_64-linux."2a-emulator";
# Add my mensa tool
mensa = inputs.mensa.packages."${system}".mensa;
fend = inputs.fend.packages."${system}".fend;
mensa = inputs.mensa.packages.x86_64-linux.mensa;
fend = inputs.fend.packages.x86_64-linux.fend;
})
# Some program adjustments
(import ./overlays/logisim.nix)
(import ./overlays/cataclysm-dda.nix)
];
};
@ -141,13 +138,13 @@
nixosConfigurations.helix-texta = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./system/helix-texta.nix
./system/light-actkbd.nix
./system/modules/scanner.nix
self.nixosModules.helix-texta-hardware
./hosts/helix-texta.nix
./modules/light-actkbd.nix
./modules/scanner.nix
self.nixosModules.thinkpad-p1-gen3
home-manager.nixosModules.home-manager
self.nixosModules.home-manager
self.nixosModules.basics
self.nixosModules.x86_64-linux-basics
({ pkgs, ... }: {
nix = {
@ -155,25 +152,23 @@
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_latest;
# Overlays only relevant to my primary laptop
nixpkgs.overlays = [
# Use packages from nixpkgs-wayland
inputs.nixpkgs-wayland.overlay
inputs.fenix.overlay
(import ./overlays/sane-backends.nix)
(import ./overlays/logisim.nix)
];
})
];
@ -183,11 +178,11 @@
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
self.nixosModules.x86_64-linux-basics
./hosts/achatina-fulica.nix
./hardware/netcup-minimal.nix
./modules/nginx-reverse-proxy.nix
./modules/radicale.nix
];
};
@ -195,11 +190,11 @@
nixosConfigurations.elysia-clarki = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
self.nixosModules.basics
./system/elysia-clarki.nix
./system/elysia-clarki-hardware.nix
./system/modules/nginx-reverse-proxy.nix
./system/modules/binary-cache.nix
self.nixosModules.x86_64-linux-basics
./hosts/elysia-clarki.nix
./hardware/intel-nuc.nix
./modules/nginx-reverse-proxy.nix
./modules/binary-cache.nix
({ pkgs, ... }: {
# 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
bluetooth.enable = true;
nvidia.modesetting.enable = true;
nvidia.prime = {
nvidiaBusId = "PCI:1:0:0";
intelBusId = "PCI:0:2:0";
};
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
@ -46,6 +50,7 @@
};
services.blueman.enable = true;
services.xserver.videoDrivers = lib.mkForce [ "nouveau" ];
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
@ -54,7 +59,6 @@
services.fprintd.enable = true;
services.hardware.bolt.enable = true;
system.fsPackages = [ pkgs.sshfs ];
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";

View file

@ -32,22 +32,9 @@ in {
hostName = "helix-texta";
# nm ftw
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" ]; };
hardware.nvidia.modesetting.enable = true;
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
hardware.opengl.enable = true;
system.fsPackages = [ pkgs.sshfs ];
# Pipewire for my wayland
sound.enable = false;
@ -165,7 +152,6 @@ in {
virtualisation = {
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
dockerSocket.enable = true;