commit 9dc30dc2a0e61dac50b320ee6eb1f81aa509ba16 Author: martyTF Date: Mon Dec 15 00:00:26 2025 +0100 initial commit with 30% less flair than usual ngl diff --git a/boot.nix b/boot.nix new file mode 100644 index 0000000..625805b --- /dev/null +++ b/boot.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +{ + system = { + autoUpgrade = { + enable = false; + allowReboot = false; + }; + }; + boot = { + loader = { + systemd-boot = { + enable = true; + editor = false; + }; + timeout = 3; + efi.canTouchEfiVariables = true; + }; + kernelPackages = pkgs.linuxPackages_zen; + kernel = { + sysctl = { + "vm.swappiness" = 10; + }; + }; + }; +} diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..1f230c7 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,28 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, inputs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./imports.nix + ]; + # 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. It‘s 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 = "25.11"; # Did you read the comment? +} + + + + + + + + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6d0f9d6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1765682243, + "narHash": "sha256-yeCxFV/905Wr91yKt5zrVvK6O2CVXWRMSrxqlAZnLp0=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "58bf3ecb2d0bba7bdf363fc8a6c4d49b4d509d03", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1765472234, + "narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "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..c4beb9e --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + description = "MartyTF's NixOS flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { self, nixpkgs, home-manager, ... }: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in + { + nixosConfigurations = { + marty-pc = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ ./configuration.nix ./marty-pc.nix ]; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..14869bc --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,40 @@ +# 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 = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/a26cdc8b-abc9-47cf-ad33-c81e56e56d22"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/C9B2-7254"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/24ecde92-b41b-4e41-8ebc-950d321db477"; } + ]; + + # 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.enp42s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/imports.nix b/imports.nix new file mode 100644 index 0000000..9652001 --- /dev/null +++ b/imports.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./boot.nix + ]; +} diff --git a/marty-pc.nix b/marty-pc.nix new file mode 100644 index 0000000..bbc869d --- /dev/null +++ b/marty-pc.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +{ + networking = { + hostName = "marty-pc"; + interfaces = { + enp42s0 = { + wakeOnLan = { + enable = true; + policy = [ "magic" ]; + }; + }; + }; + }; + fileSystems = { + "/mnt/SSD" = { + device = "/dev/disk/by-uuid/af5282f0-0e02-4532-902f-97509af70d11"; + fsType = "ext4"; + }; + "/mnt/HDD" = { + device = "/dev/disk/by-uuid/41e7ec41-2e43-4254-9f00-f4be98cddc6e"; + fsType = "ext4"; + }; + }; + +}