move systems into a separate directory

This commit is contained in:
uku 2023-11-14 18:29:14 +01:00
parent 89f997e158
commit 18121a0f9f
Signed by: uku
GPG key ID: 7D01D7B105E77166
9 changed files with 111 additions and 88 deletions

59
systems/common.nix Normal file
View file

@ -0,0 +1,59 @@
{
pkgs,
nixpkgs,
...
}: {
environment.systemPackages = with pkgs; [
neovim
git
curl
nix-your-shell
];
programs = {
fish = {
enable = true;
interactiveShellInit = ''
nix-your-shell fish | source
'';
};
direnv.enable = true;
command-not-found.enable = false;
nix-index = {
enable = true;
enableFishIntegration = true;
};
};
nixpkgs.config.allowUnfree = true;
nix = {
gc = {
automatic = true;
dates = "3d";
options = "-d";
};
settings = {
auto-optimise-store = true;
experimental-features = ["nix-command" "flakes"];
};
};
nix.registry = let
nixpkgsRegistry.flake = nixpkgs;
in {
nixpkgs = nixpkgsRegistry;
n = nixpkgsRegistry;
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

44
systems/default.nix Normal file
View file

@ -0,0 +1,44 @@
{
lib,
inputs,
...
}: let
# shamelessly borrowed from https://github.com/getchoo/flake/blob/94dc521310b34b80158d1a0ab65d4daa3a44d81e/systems/default.nix
toSystem = builder: name: args:
(args.builder or builder) (
(builtins.removeAttrs args ["builder"])
// {
modules =
args.modules
++ [
./common.nix
./${name}
./${name}/hardware-configuration.nix
{networking.hostName = name;}
];
specialArgs = inputs;
}
);
mapNixOS = lib.mapAttrs (toSystem inputs.nixpkgs.lib.nixosSystem);
desktop = with inputs; [
./desktop.nix
lanzaboote.nixosModules.lanzaboote
home-manager.nixosModules.home-manager
];
in {
flake.nixosConfigurations = mapNixOS {
fuji = {
system = "x86_64-linux";
modules = desktop;
};
kilimandjaro = {
system = "x86_64-linux";
modules = desktop;
};
};
}

180
systems/desktop.nix Normal file
View file

@ -0,0 +1,180 @@
{
lib,
pkgs,
getchvim,
...
}: let
username = "leo";
in {
imports = [
../programs
(lib.mkAliasOptionModule ["hm"] ["home-manager" "users" username])
];
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_zen;
loader = {
systemd-boot.enable = lib.mkForce false;
efi.canTouchEfiVariables = true;
};
lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
};
hardware = {
opengl.enable = true;
pulseaudio.enable = false;
};
sound.enable = true;
services = {
# apparently needed for mesa
xserver = {
enable = true;
xkb.layout = "fr";
displayManager = {
lightdm.enable = false;
gdm = {
enable = true;
wayland = true;
};
defaultSession = "hyprland";
};
};
printing.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
};
udisks2.enable = true;
gvfs.enable = true;
gnome.gnome-keyring.enable = true;
};
xdg = {
portal = {
enable = true;
extraPortals = with pkgs; [xdg-desktop-portal-gtk];
};
mime.enable = true;
icons.enable = true;
};
networking.networkmanager.enable = true;
time.timeZone = "Europe/Paris";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "fr_FR.UTF-8";
LC_IDENTIFICATION = "fr_FR.UTF-8";
LC_MEASUREMENT = "fr_FR.UTF-8";
LC_MONETARY = "fr_FR.UTF-8";
LC_NAME = "fr_FR.UTF-8";
LC_NUMERIC = "fr_FR.UTF-8";
LC_PAPER = "fr_FR.UTF-8";
LC_TELEPHONE = "fr_FR.UTF-8";
LC_TIME = "fr_FR.UTF-8";
};
console.keyMap = "fr";
security.rtkit.enable = true;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
hm = {
home.packages = with pkgs; let
inherit (pkgs.stdenv.hostPlatform) system;
in [
firefox
kitty
chezmoi
starship
font-manager
polkit_gnome
nwg-look
(catppuccin-gtk.override {
variant = "macchiato";
accents = ["sky" "sapphire"];
})
jetbrains.idea-ultimate
jetbrains.webstorm
jetbrains.rust-rover
jetbrains.clion
mold
sccache
pavucontrol
obs-studio
mpv
glfw-wayland-minecraft
(prismlauncher.override {
jdks = [temurin-bin-17];
})
vesktop
mate.eom
osu-lazer-bin
gnome.file-roller
getchvim.packages.${system}.default
];
services = {
gpg-agent = {
enable = true;
enableSshSupport = true;
pinentryFlavor = "gnome3";
};
};
};
programs = {
gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "gnome3";
};
seahorse.enable = true;
steam.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [thunar-volman thunar-archive-plugin];
};
};
security.pam.services.greetd.enableGnomeKeyring = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.${username} = {
isNormalUser = true;
shell = pkgs.fish;
extraGroups = ["networkmanager" "wheel" "video"];
};
fonts.packages = with pkgs; [
iosevka
jetbrains-mono
cantarell-fonts
(nerdfonts.override {fonts = ["Iosevka" "JetBrainsMono"];})
];
environment.systemPackages = with pkgs; [sbctl];
hm.home.stateVersion = "23.11";
}

7
systems/fuji/default.nix Normal file
View file

@ -0,0 +1,7 @@
{lib, ...}: {
# imports = [./nvidia.nix];
services.xserver.videoDrivers = ["amdgpu"];
hm.wayland.windowManager.hyprland.settings.monitor = lib.mkForce ["DP-1,1920x1200@60,0x0,1" "HDMI-A-1,1440x900@60,1920x300,1"];
}

View file

@ -0,0 +1,54 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/660ff32b-308f-411a-815e-959706ec1bcb";
fsType = "btrfs";
options = ["subvol=@"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/306D-3240";
fsType = "vfat";
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/eb612572-5d15-407b-b691-e7486a69d33c";
fsType = "ext4";
};
fileSystems."/mnt/videos" = {
device = "/dev/disk/by-uuid/b7f70053-dda2-4084-bd92-ddeccb4b4950";
fsType = "btrfs";
};
swapDevices = [
{device = "/dev/disk/by-uuid/6ee8ec3d-3b26-4d6d-b43d-174f908fd8fe";}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

35
systems/fuji/nvidia.nix Normal file
View file

@ -0,0 +1,35 @@
{lib, ...}: {
services.xserver.videoDrivers = lib.mkForce ["nvidia"];
hardware.opengl = {
driSupport = true;
driSupport32Bit = true;
};
hardware.nvidia = {
modesetting.enable = true;
powerManagement = {
enable = true;
finegrained = false;
};
open = false;
nvidiaSettings = true;
};
boot.extraModprobeConfig = ''
options nvidia NVreg_RegistryDwords="PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3"
'';
programs.hyprland.enableNvidiaPatches = true;
hm.wayland.windowManager.hyprland.settings.env = [
"LIBVA_DRIVER_NAME,nvidia"
"XDG_SESSION_TYPE,wayland"
"GBM_BACKEND,nvidia-drm"
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
"WLR_NO_HARDWARE_CURSORS,1"
"__EGL_VENDOR_LIBRARY_FILENAMES,/run/opengl-driver/share/glvnd/egl_vendor.d/10_nvidia.json"
"NVD_BACKEND,direct"
"MOZ_DISABLE_RDD_SANDBOX,1"
];
}

View file

@ -0,0 +1,13 @@
{pkgs, ...}: {
hardware.bluetooth.enable = true;
services.blueman.enable = true;
services.xserver = {
videoDrivers = ["intel"];
libinput.enable = true;
};
programs.light.enable = true;
users.users.leo.packages = with pkgs; [networkmanagerapplet];
}

View file

@ -0,0 +1,49 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "vmd" "nvme" "usb_storage" "sd_mod" "rtsx_usb_sdmmc"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/e082a535-4b7c-4b24-af1c-0373eefd3c05";
fsType = "btrfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/224F-E1A3";
fsType = "vfat";
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/5fe52c56-54f7-426b-afb7-7cf6a58b7cf0";
fsType = "ext4";
};
swapDevices = [
{device = "/dev/disk/by-uuid/2a5ce834-4a58-45ab-955f-5b620d503f7b";}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}