diff options
author | Jasper Ras <jaspert.ras@gmail.com> | 2024-10-23 08:50:57 +0200 |
---|---|---|
committer | Jasper Ras <jaspert.ras@gmail.com> | 2024-10-23 08:50:57 +0200 |
commit | d9511a642b80c16db6508bc1f4b51f229c257b3a (patch) | |
tree | a9cdf25f7e0f74abc484cb45fce25ea86bf0853a |
Initial commit
-rw-r--r-- | configuration.nix | 93 | ||||
-rw-r--r-- | flake.lock | 416 | ||||
-rw-r--r-- | flake.nix | 33 | ||||
-rw-r--r-- | gaming.nix | 28 | ||||
-rw-r--r-- | hardware-configuration.nix | 40 | ||||
-rw-r--r-- | home-manager.nix | 7 | ||||
-rw-r--r-- | keyd.nix | 12 | ||||
-rw-r--r-- | networking.nix | 28 | ||||
-rw-r--r-- | packages.nix | 16 | ||||
-rw-r--r-- | services.nix | 51 |
10 files changed, 724 insertions, 0 deletions
diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..17aceae --- /dev/null +++ b/configuration.nix @@ -0,0 +1,93 @@ +# 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’). + +{ lib, config, pkgs, ... }: + +{ + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + open = false; + nvidiaSettings = true; + nvidiaPersistenced = true; + + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + + security.rtkit.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Amsterdam"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "nl_NL.UTF-8"; + LC_IDENTIFICATION = "nl_NL.UTF-8"; + LC_MEASUREMENT = "nl_NL.UTF-8"; + LC_MONETARY = "nl_NL.UTF-8"; + LC_NAME = "nl_NL.UTF-8"; + LC_NUMERIC = "nl_NL.UTF-8"; + LC_PAPER = "nl_NL.UTF-8"; + LC_TELEPHONE = "nl_NL.UTF-8"; + LC_TIME = "nl_NL.UTF-8"; + }; + + # Configure console keymap + console.keyMap = "us-acentos"; + + programs.zsh.enable = true; + programs.gnupg = { + agent.enable = true; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.jras = { + isNormalUser = true; + description = "Jasper"; + extraGroups = [ "networkmanager" "wheel" "audio" ]; + shell = pkgs.zsh; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + environment.sessionVariables = { + TERMINAL = "alacritty"; + EDITOR = "helix"; + }; + + environment.pathsToLink = [ "/libexec" ]; + + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # 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 = "24.05"; # Did you read the comment? + +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..e8a4a1c --- /dev/null +++ b/flake.lock @@ -0,0 +1,416 @@ +{ + "nodes": { + "crane": { + "locked": { + "lastModified": 1727974419, + "narHash": "sha256-WD0//20h+2/yPGkO88d2nYbb23WMWYvnRyDQ9Dx4UHg=", + "owner": "ipetkov", + "repo": "crane", + "rev": "37e4f9f0976cb9281cd3f0c70081e5e0ecaee93f", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "crane_2": { + "inputs": { + "nixpkgs": [ + "home-jras", + "helix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709610799, + "narHash": "sha256-5jfLQx0U9hXbi2skYMGodDJkIgffrjIOgMRjZqms2QE=", + "owner": "ipetkov", + "repo": "crane", + "rev": "81c393c776d5379c030607866afef6406ca1be57", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1709126324, + "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "d465f4819400de7c8d874d50b982301f28a84605", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "helix": { + "inputs": { + "crane": "crane", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1729477666, + "narHash": "sha256-ri40XjKyZIMH5wBCFNa50dq5wTBPF5qH/NVDo+syhNM=", + "owner": "helix-editor", + "repo": "helix", + "rev": "6d64e6288add793caf1c841ea295518414c04ea0", + "type": "github" + }, + "original": { + "owner": "helix-editor", + "ref": "master", + "repo": "helix", + "type": "github" + } + }, + "helix_2": { + "inputs": { + "crane": "crane_2", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2", + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1729331287, + "narHash": "sha256-CiQsoNEOGHkSfG/0JJMegHfwXUAI0PwAIVj3i3FmGao=", + "owner": "helix-editor", + "repo": "helix", + "rev": "be2884d80061493ab1999d73ffa51dfb4f59639d", + "type": "github" + }, + "original": { + "owner": "helix-editor", + "ref": "master", + "repo": "helix", + "type": "github" + } + }, + "home-jras": { + "inputs": { + "helix": "helix_2", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs_3", + "zen-browser": "zen-browser" + }, + "locked": { + "lastModified": 1729663713, + "narHash": "sha256-nAwjs8WMd35OSItHgG+refjHEpU2MSIv5lWaRvItIeI=", + "path": "/home/jras/home-manager", + "type": "path" + }, + "original": { + "path": "/home/jras/home-manager", + "type": "path" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "home-jras", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729414726, + "narHash": "sha256-Dtmm1OU8Ymiy9hVWn/a2B8DhRYo9Eoyx9veERdOBR4o=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "fe56302339bb28e3471632379d733547caec8103", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1726989464, + "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.05", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1728018373, + "narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "bc947f541ae55e999ffdb4013441347d83b00feb", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1709479366, + "narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b8697e57f10292a6165a20f03d2f42920dfaf973", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1729256560, + "narHash": "sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c+cHUJwA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1727348695, + "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1716542732, + "narHash": "sha256-0Y9fRr0CUqWT4KgBITmaGwlnNIGMYuydu2L8iLTfHU4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d12251ef6e8e6a46e05689eeccd595bdbd3c9e60", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1729449015, + "narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "89172919243df199fe237ba0f776c3e3e3d72367", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1727348695, + "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "helix": "helix", + "home-jras": "home-jras", + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_6", + "zen-browser": "zen-browser_2" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "helix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1728268235, + "narHash": "sha256-lJMFnMO4maJuNO6PQ5fZesrTmglze3UFTTBuKGwR1Nw=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "25685cc2c7054efc31351c172ae77b21814f2d42", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { + "inputs": { + "flake-utils": [ + "home-jras", + "helix", + "flake-utils" + ], + "nixpkgs": [ + "home-jras", + "helix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709604635, + "narHash": "sha256-le4fwmWmjGRYWwkho0Gr7mnnZndOOe4XGbLw68OvF40=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "e86c0fb5d3a22a5f30d7f64ecad88643fe26449d", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "zen-browser": { + "inputs": { + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1727721329, + "narHash": "sha256-QYlWZwUSwrM7BuO+dXclZIwoPvBIuJr6GpFKv9XKFPI=", + "owner": "MarceColl", + "repo": "zen-browser-flake", + "rev": "e6ab73f405e9a2896cce5956c549a9cc359e5fcc", + "type": "github" + }, + "original": { + "owner": "MarceColl", + "repo": "zen-browser-flake", + "type": "github" + } + }, + "zen-browser_2": { + "inputs": { + "nixpkgs": "nixpkgs_7" + }, + "locked": { + "lastModified": 1727721329, + "narHash": "sha256-QYlWZwUSwrM7BuO+dXclZIwoPvBIuJr6GpFKv9XKFPI=", + "owner": "MarceColl", + "repo": "zen-browser-flake", + "rev": "e6ab73f405e9a2896cce5956c549a9cc359e5fcc", + "type": "github" + }, + "original": { + "owner": "MarceColl", + "repo": "zen-browser-flake", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..fce4308 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "My NixOS Flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + home-manager.url = "github:nix-community/home-manager/release-24.05"; + helix.url = "github:helix-editor/helix/master"; + home-jras.url = "path:/home/jras/home-manager"; + zen-browser.url = "github:MarceColl/zen-browser-flake"; + }; + + outputs = { self, nixpkgs, home-manager, home-jras, ... }@inputs: { + nixosConfigurations.tarrel = nixpkgs.lib.nixosSystem { + modules = [ + ./configuration.nix + ./hardware-configuration.nix + ./gaming.nix + ./networking.nix + ./keyd.nix + ./services.nix + ./packages.nix + + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.jras = import "${home-jras}/entrypoints/personal.nix"; + + home-manager.extraSpecialArgs = { inherit inputs; }; + } + ]; + }; + }; +} diff --git a/gaming.nix b/gaming.nix new file mode 100644 index 0000000..768af12 --- /dev/null +++ b/gaming.nix @@ -0,0 +1,28 @@ +{ config, pkgs, ... }: + +{ + programs.steam.enable = true; + + services.sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + settings = { + output_name = 1; + }; + applications = { + apps = [ + { + name = "Auto Desktop"; + prep-cmd = [ + { + do = ""; + undo = ""; + } + ]; + } + ]; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..4604fcd --- /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 = [ "xhci_pci" "ahci" "nvme" "usbhid" "uas" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/b73c41ec-fe01-4fa5-b50a-fd871e8c2710"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/BBB8-1AF8"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + 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.<interface>.useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f0u9.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home-manager.nix b/home-manager.nix new file mode 100644 index 0000000..67ba932 --- /dev/null +++ b/home-manager.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ...}: { + home-manager.users.jras = { pkgs, ... }: { + imports = ["/home/jras/home-manager/common.nix"]; + + home.stateVersion = "24.05"; + }; +} diff --git a/keyd.nix b/keyd.nix new file mode 100644 index 0000000..6b4e79d --- /dev/null +++ b/keyd.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + services.keyd = { + enable = true; + keyboards = { + default = { + ids = [ "*" ]; + settings.main.capslock = "overload(meta, esc)"; + }; + }; + }; +} diff --git a/networking.nix b/networking.nix new file mode 100644 index 0000000..2eb5ade --- /dev/null +++ b/networking.nix @@ -0,0 +1,28 @@ +{ config, pkgs, ... }: +{ + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + networking.networkmanager.enable = true; + networking.hostName = "tarrel"; + + services.unifi = { + enable = true; + unifiPackage = pkgs.unifi8; + }; + + # from: https://help.ui.com/hc/en-us/articles/218506997-Required-Ports-Reference + # best put it in a var somewhere + networking.firewall.allowedTCPPorts = [ 53 8080 443 8443 8880 8843 6789 27117 ]; + networking.firewall.allowedUDPPorts = [ 53 3478 5514 10001 1900 123]; + networking.firewall.allowedUDPPortRanges = [ { from = 5656; to = 5699; } ]; +} diff --git a/packages.nix b/packages.nix new file mode 100644 index 0000000..a21aa7a --- /dev/null +++ b/packages.nix @@ -0,0 +1,16 @@ +# 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, ... }: + +{ + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + helix + alacritty + firefox + git + ]; +} diff --git a/services.nix b/services.nix new file mode 100644 index 0000000..02947e1 --- /dev/null +++ b/services.nix @@ -0,0 +1,51 @@ +# 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’). + +{ pkgs, ... }: + +{ + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + services.displayManager.defaultSession = "none+i3"; + services.displayManager.autoLogin.enable = true; + services.displayManager.autoLogin.user = "jras"; + services.xserver = { + enable = true; + videoDrivers = ["nvidia"]; + windowManager.i3 = { enable = true; + extraPackages = with pkgs; [ + dmenu + i3status + i3lock + i3blocks + ]; + }; + xkb = { + layout = "us"; + variant = "intl"; + }; + }; + + location.latitude = 52.49931951214914; + location.longitude = 4.816707180055415; + + services.redshift = { + enable = true; + + temperature = { + day = 5500; + night = 4500; + }; + + brightness = { + day = "0.8"; + night = "0.7"; + }; + }; +} |