From 00add66a979b62b624ba42f3c6e84e05059a8986 Mon Sep 17 00:00:00 2001 From: alyx Date: Fri, 20 Feb 2026 23:07:13 +0000 Subject: [PATCH] first commit --- flake.lock | 48 ++++++++ flake.nix | 33 ++++++ home/default.nix | 61 ++++++++++ hosts/absolution/absolution.nix | 30 +++++ hosts/absolution/default.nix | 6 + hosts/absolution/hardware-configuration.nix | 77 +++++++++++++ hosts/generic.nix | 117 ++++++++++++++++++++ variables.nix | 19 ++++ 8 files changed, 391 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home/default.nix create mode 100644 hosts/absolution/absolution.nix create mode 100644 hosts/absolution/default.nix create mode 100644 hosts/absolution/hardware-configuration.nix create mode 100644 hosts/generic.nix create mode 100644 variables.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a5ea4e1 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1771531206, + "narHash": "sha256-1R3Wx6KUkMb4x4E5UOhW9p6rqiexzSGGWxZqSHqW5n0=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "91be7cce763fa4022c7cf025a71b0c366d1b6e77", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1771567102, + "narHash": "sha256-22ze9Zqnddb3F0cGkjqvy6SY47iFC0KCAm5eUzjMnsk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "61258584a9111e01f5cd051713a2ebae0c9c70bd", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..64c9b23 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "maowwww"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = inputs@{self, nixpkgs, home-manager, ...}:{ + nixosConfigurations."apalapucia" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/absolution + ./variables.nix + { config.var.username = "alyx"; } + home-manager.nixosModules.home-manager { + home-manager.extraSpecialArgs = { + inherit inputs; + vars = { + class = "desktop"; + user = "alyx"; + }; + }; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.alyx = ./home; + } + ]; + }; + }; +} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..662ef07 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,61 @@ +{config, pkgs, lib, inputs, vars, ...}:{ + imports = [ + # things we import later + ]; + + home = rec { + username = vars.user; + homeDirectory = "/home/${username}"; + stateVersion = "26.05"; + shell.enableBashIntegration = true; + #file = { + # we will deal with later + #}; + }; + + programs.home-manager.enable = true; + programs.foot = { + enable = true; + settings.main.font = "monospace:size=20"; + settings.colors.alpha = "0.9"; + }; + + programs.ncmpcpp = { + enable = true; + settings = { + tags_separator = ";"; + }; + }; + + services.mpd = { + enable = true; + musicDirectory = "/home/${vars.user}/Music"; + extraConfig = '' + audio_output { + type "pipewire" + name "default pipewire" + } + ''; + }; + + services.mpd-mpris.enable = true; + + services.mpd-discord-rpc.enable = true; + + programs.waybar.enable = true; + + programs.git = { + enable = true; + settings = { + user.name = vars.user; + user.email = "blankfornow"; + commit.gpgsign = true; + gpg.format = "ssh"; + user.signingKey = "~/.ssh/id_ed25519.pub"; + init.defaultBranch = "master"; + }; + }; + + programs.obs-studio.enable = true; + } + diff --git a/hosts/absolution/absolution.nix b/hosts/absolution/absolution.nix new file mode 100644 index 0000000..4186888 --- /dev/null +++ b/hosts/absolution/absolution.nix @@ -0,0 +1,30 @@ +{ config, pkgs, lib, inputs, ...}:{ + + imports = [ + ./hardware-configuration.nix + ]; + + boot.initrd.luks.devices = { + crypted = { + device = "/dev/disk/by-partuuid/79ab4cc0-b596-42ed-ad00-69031b01b09b"; + allowDiscards = true; + preLVM = true; + }; + }; + + systemd.packages = with pkgs; [lact]; + + programs.bash.shellAliases = { + nano = "nvim"; + }; + + services.printing.enable = true; + services.printing.drivers = [pkgs.gutenprint]; + + users.users.${config.var.username} = { + description = "Alyx Wren"; + extraGroups = [ "networkmanager" "wheel" "camera" "input" "adbusers" "inputs" "uinput" "pipewire" ]; + }; +} + + diff --git a/hosts/absolution/default.nix b/hosts/absolution/default.nix new file mode 100644 index 0000000..4082110 --- /dev/null +++ b/hosts/absolution/default.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }:{ + imports = [ + ./absolution.nix + ../generic.nix + ]; +} diff --git a/hosts/absolution/hardware-configuration.nix b/hosts/absolution/hardware-configuration.nix new file mode 100644 index 0000000..5ac75c3 --- /dev/null +++ b/hosts/absolution/hardware-configuration.nix @@ -0,0 +1,77 @@ +# 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") + ]; + + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General.Experimental = true; + }; + input = { + General.ClassicBondedOnly = false; + General.UserspaceHID = true; + }; + }; + + boot.supportedFilesystems = ["exfat" "ntfs" "xfs"]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ "vfio_pci" "vfio" "vfio_iommu_type1" "vendor-reset" ]; + boot.kernelModules = [ "kvm-intel" "vfio_virqfd" "vhost-net" "v4l2loopback" "12c-dev" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback vendor-reset hid-t150 ]; + boot.extraModprobeConfig = '' + options vfio-pci ids=1002:6fdf,1002:aaf0,,1002:67df,8086:8d26,8086:8d2d + options v4l2loopback devices=2 video_nr=1,2 card_label="Lenovo Camera" exclusive_caps=1 + ''; + boot.blacklistedKernelModules = ["nouveau"]; + boot.kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" "intel_iommu=on" "iommu=pt" "preempt=voluntary" "module_blacklist=nouveau" ]; + #boot.kernelPackages = pkgs.linuxKernel.packages.linux_xanmod_latest; + + + + fileSystems."/" = + { device = "/dev/mapper/vg-nixos"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/243D-443E"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + fileSystems."/mnt/data" = + { device = "/dev/disk/by-uuid/09c2cf4d-25b8-4a1b-9b7a-904f4a97a20d"; + fsType = "xfs"; + options = [ "x-gvfs-show" ]; + }; + + fileSystems."/mnt/misc" = + { device = "/dev/disk/by-uuid/1375e97d-e67b-43b7-827c-c1b984e0f42f"; + fsType = "xfs"; + options = [ "x-gvfs-show" ]; + }; + + fileSystems."/mnt/nvme" = + { device = "/dev/disk/by-uuid/d95cde51-6c51-477c-af71-d59f02fe527c"; + fsType = "xfs"; + options = [ "x-gvfs-show" ]; + }; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/generic.nix b/hosts/generic.nix new file mode 100644 index 0000000..b4f667b --- /dev/null +++ b/hosts/generic.nix @@ -0,0 +1,117 @@ +{ config, pkgs, lib, inputs, ...}: + +{ + imports = [ +# ../../pkgs + ]; + + nix.settings.experimental-features = "nix-command flakes"; + + networking.networkmanager = { + enable = true; + }; + + networking.hostName = config.var.hostname; + + time.timeZone = config.var.timezone; + + i18n.defaultLocale = config.var.locale; + i18n.extraLocaleSettings = { + LC_ADDRESS = config.var.locale; + LC_IDENTIFICATION = config.var.locale; + LC_MEASUREMENT = config.var.locale; + LC_MONETARY = config.var.locale; + LC_NAME = config.var.locale; + LC_NUMERIC = config.var.locale; + LC_PAPER = config.var.locale; + LC_TELEPHONE = config.var.locale; + LC_TIME = config.var.locale; + }; + + services.gnome.gnome-keyring.enable = true; + security.pam.services.greetd.enableGnomeKeyring = true; + security.pam.services.greetd.gnupg.enable = true; + + security.pam.services.login = { + enableGnomeKeyring = true; + gnupg.enable = true; + }; + + systemd.user.services.polkit-gnome-authentication-agent-1 = { + description = "polkit-gnome-authentication-agent-1"; + wantedBy = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + + security.polkit.enable = true; + boot.loader.systemd-boot.enable = false; + boot.loader.limine = { + enable = true; + style.wallpapers = []; + additionalFiles = { + "efi/memtest86/memtest86.efi" = "${pkgs.memtest86-efi}/BOOTX64.efi"; + "efi/shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi"; + }; + extraEntries = '' + /memtest86 + protocol: efi + path: boot():/limine/efi/memtest86/memtest86.efi + /shell + protocol: efi + path: boot():/limine/efi/shell.efi + ''; + }; + boot.loader.efi.canTouchEfiVariables = true; + + powerManagement.cpuFreqGovernor = "performance"; + services.gvfs.enable = true; + + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = with pkgs; [mesa.opencl libvdpau-va-gl libva-vdpau-driver vulkan-validation-layers]; + extraPackages32 = with pkgs; [driversi686Linux.mesa.opencl]; + }; + + services.xserver.enable = true; + programs.dconf.enable = true; + + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + + services.udisks2.enable = true; + + users.users.${config.var.username} = { + isNormalUser = true; + }; + + services.libinput.enable = true; + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + + + ]; + + system.stateVersion = "26.05"; +} diff --git a/variables.nix b/variables.nix new file mode 100644 index 0000000..23c2162 --- /dev/null +++ b/variables.nix @@ -0,0 +1,19 @@ +{ lib, config, pkgs, ... }: +{ + options.var = with lib.types; { + # host-specific options + username = lib.mkOption { type = str; }; + hostname = lib.mkOption { type = str;}; + #[...] + # Variables shared by all hosts + locale = lib.mkOption { type = str;}; + timezone = lib.mkOption { type = str;}; + #[...] + }; + config.var = { + # Variables shared by all hosts + locale = "de_DE.UTF-8"; + timezone = "Europe/Berlin"; + }; +} +