From 8cf26124211f74ae83f1ef4569cacfeeafdaf136 Mon Sep 17 00:00:00 2001 From: Joshua Seiger-Eatwell Date: Mon, 9 Jun 2025 22:42:37 +0200 Subject: [PATCH] feat: added nixos config --- flake.lock | 27 +++++++++++++ flake.nix | 31 +++++++++++++++ nixos/applications.nix | 12 ++++++ nixos/configuration.nix | 67 ++++++++++++++++++++++++++++++++ nixos/hardware-configuration.nix | 37 ++++++++++++++++++ nixos/system-packages.nix | 6 +++ 6 files changed, 180 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 nixos/applications.nix create mode 100644 nixos/configuration.nix create mode 100644 nixos/hardware-configuration.nix create mode 100644 nixos/system-packages.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a67fb22 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1749285348, + "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1986338 --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + description = "OS Config"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config = { + allowUnfree = true; + }; + }; + + in + { + + nixosConfigurations = { + x600 = nixpkgs.lib.nixosSystem { + specialArgs = { inherit system; }; + modules = [ + ./nixos/configuration.nix + ]; + }; + }; + + }; +} diff --git a/nixos/applications.nix b/nixos/applications.nix new file mode 100644 index 0000000..152f3bf --- /dev/null +++ b/nixos/applications.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + darktable + keepassxc + amberol + siril + vscode + signal-desktop + thunderbird + ]; +} diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..18fa47a --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,67 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ./system-packages.nix + ./applications.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "nixos"; + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Copenhagen"; + + i18n.defaultLocale = "en_DK.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "da_DK.UTF-8"; + LC_IDENTIFICATION = "da_DK.UTF-8"; + LC_MEASUREMENT = "da_DK.UTF-8"; + LC_MONETARY = "da_DK.UTF-8"; + LC_NAME = "da_DK.UTF-8"; + LC_NUMERIC = "da_DK.UTF-8"; + LC_PAPER = "da_DK.UTF-8"; + LC_TELEPHONE = "da_DK.UTF-8"; + LC_TIME = "da_DK.UTF-8"; + }; + + services.displayManager.gdm.enable = true; + services.desktopManager.gnome.enable = true; + + services.xserver.xkb = { + layout = "dk"; + variant = ""; + }; + + console.keyMap = "dk-latin1"; + services.printing.enable = true; + + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + users.users.joshua = { + isNormalUser = true; + description = "Joshua Seiger-Eatwell"; + extraGroups = [ "networkmanager" "wheel" ]; + }; + + programs.firefox.enable = true; + + nixpkgs.config.allowUnfree = true; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + system.stateVersion = "25.05"; # Did you read the comment? + +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..9969650 --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,37 @@ +# 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 + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/d3cc3dcf-9bbf-4ad3-80df-55ee3a939387"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D74E-06EA"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + # 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.enp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/nixos/system-packages.nix b/nixos/system-packages.nix new file mode 100644 index 0000000..2668570 --- /dev/null +++ b/nixos/system-packages.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + vim + ]; +}