diff --git a/README.md b/README.md index 44499a1..db6c1a6 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # 0x29a nixos config -My personal nixos configuration files. +My personal nixos configuration files for different environments. ## basic system installation -- The installations in this repository are always luks encrypted +- The installations presented in this repository are always luks encrypted - For simplicity I'm using device labels rather than uuids 1. the partitioning layout should look somewhat like this after the installation @@ -111,8 +111,24 @@ $ sudo nixos-rebuild --install-bootloader switch --flake .#host_name $ cd /path/to/repo $ sudo nix flake update $ sudo nixos-rebuild switch --flake .#host_name +$ sudo nix-collect-garbage ``` +## how to use nix-helper + +The tool nix-helper is installed by this configuration. It simplifies administrating nixos and adds more output to the rebuild command. It also features a diff after a successful build. The command uses the `NH_FLAKE` environment variable to be able to run from whatever directory. + +Basic commands with a set `NH_FLAKE` variable are: + +```bash +$ nh os switch +$ nh os build +$ nh os test +$ nh clean all --keep 5 +``` + +There is also the option to interface with home-manager by using `nh home switch`but this isn't necessary since home-manager is imported as a module in this config. + ## author aaron diff --git a/flake.lock b/flake.lock index 964f485..306b33a 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1766282146, - "narHash": "sha256-0V/nKU93KdYGi+5LB/MVo355obBJw/2z9b2xS3bPJxY=", + "lastModified": 1767048910, + "narHash": "sha256-KLFTeA/xquN+F3XHLAXcserk0L0nijbhzuldxNDF1eE=", "owner": "nix-community", "repo": "home-manager", - "rev": "61fcc9de76b88e55578eb5d79fc80f2b236df707", + "rev": "d99b4ca5debaa082c7d76015aa2b7f3fc7e8b5f7", "type": "github" }, "original": { @@ -43,11 +43,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1766070988, - "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", + "lastModified": 1766902085, + "narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c6245e83d836d0433170a16eb185cefe0572f8b8", + "rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4", "type": "github" }, "original": { @@ -66,11 +66,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1766273987, - "narHash": "sha256-Y8hL2zGyt7xn5J1V806GJ9tMEk6NgVlU7xe4dS4fThE=", + "lastModified": 1767002962, + "narHash": "sha256-HGFRwMRUwt56E+SiVX9YQOzpOwHy0/rtEqMoEbkF8Yg=", "owner": "nix-community", "repo": "nixvim", - "rev": "ff00fe1512dfcb31b01d770738de9299b434449b", + "rev": "63c957603751f0a107c4d9c2cbaff1c8749fc9f1", "type": "github" }, "original": { @@ -86,11 +86,11 @@ ] }, "locked": { - "lastModified": 1766317205, - "narHash": "sha256-PYlMsenwZCG5TrxQSyTraPw8WQwk4FGnbyFdFMuAeYA=", + "lastModified": 1767099893, + "narHash": "sha256-Z39jG7z4XD+H2KPSgWR0rQS3di1mTblRI5kyqcL3g7w=", "owner": "noctalia-dev", "repo": "noctalia-shell", - "rev": "51aa9fe16b0cc0dc4daa7c447843b36923434f2e", + "rev": "015ff66fbd85abda4573d864466ecf9fc64f233b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 84a902f..abe0e6e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,74 +1,59 @@ { description = "0x29a ecosystem NixOS flake"; - + inputs = { - # the main nix package collection - nixpkgs = { - url = "github:nixos/nixpkgs/nixos-unstable"; - }; - # home manager for dotfiles + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - # noctalia shell noctalia = { url = "github:noctalia-dev/noctalia-shell"; inputs.nixpkgs.follows = "nixpkgs"; }; - # nixvim nixvim = { url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - - outputs = inputs@{self, nixpkgs, home-manager, nixvim, ... }: let - lib = nixpkgs.lib; - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in { + + outputs = { self, nixpkgs, home-manager, nixvim, ... }@inputs: { nixosConfigurations = { - # default config - default = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - }; - modules = [ - # import host specific configs - ./hosts/default/configuration.nix - # import host specific hardware configs - ./hosts/default/hardware-configuration.nix - ]; - }; - # laptop neon - neon = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - }; + default = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; modules = [ - # import host specific configs - ./hosts/neon/configuration.nix - # import host specific hardware configs - ./hosts/neon/hardware-configuration.nix - # import noctalia shell configs - ./hosts/neon/noctalia.nix - # import home-manager as a module + ./hosts/default/hardware-configuration.nix + ./hosts/default/configuration.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit inputs; }; - # User specific inputs - home-manager.users.aaron = { - imports = [ - nixvim.homeModules.nixvim - ./hosts/neon/home.nix - ]; - }; + home-manager.users.aaron.imports = [ + nixvim.homeModules.nixvim + ./users/aaron/home.nix + ]; + } + ]; + }; + + neon = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/neon/hardware-configuration.nix + ./hosts/neon/configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.aaron.imports = [ + nixvim.homeModules.nixvim + ./users/aaron/home.nix + ]; } ]; }; diff --git a/hosts/neon/configuration.nix b/hosts/neon/configuration.nix index e354be7..eb174de 100644 --- a/hosts/neon/configuration.nix +++ b/hosts/neon/configuration.nix @@ -1,200 +1,23 @@ -{ pkgs, lib, inputs, ... }: +{ config, pkgs, inputs, ... }: { - imports = - [ - ./hardware-configuration.nix - ]; - - # use flakes - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - # configure bootloader - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # plymouth boot eye candy - boot.initrd.systemd.enable = true; - boot.kernelParams = [ "quiet" "loglevel=2" ]; - boot.plymouth.enable = true; - boot.plymouth.theme = "spinner"; - - # use latest kernel - boot.kernelPackages = pkgs.linuxPackages_latest; - - # networking - networking.hostName = "neon"; - networking.networkmanager.enable = true; - - # bluetooth - hardware.bluetooth.enable = true; - - # time zone. - time.timeZone = "Europe/Amsterdam"; - - # select internationalisation properties - i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - console = { - font = "Lat2-Terminus16"; - keyMap = "de_CH-latin1"; - }; - - # set up niri as window manager - programs.niri.enable = true; - # set up sddm ad display manager - services.displayManager.sddm = { - enable = true; - wayland = { - enable = true; - }; - autoNumlock = true; - enableHidpi = true; - theme = "sddm-astronaut-theme"; - settings = { - Theme = { - Current = "sddm-astronaut-theme"; - }; - }; - extraPackages = with pkgs; [ - sddm-astronaut - ]; - }; - - services.tuned.enable = true; - services.upower.enable = true; - - environment.pathsToLink = [ "/libexec" ]; - environment.variables.EDITOR = "vim"; - - # enable sound - services.pipewire = { - enable = true; - pulse.enable = true; - }; - - # define a user account - users.users.aaron = { - isNormalUser = true; - group = "users"; - extraGroups = [ "wheel" ]; - shell = pkgs.zsh; - }; - - # browser - programs.firefox.enable = true; - - # zsh config - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestions.enable = true; - ohMyZsh = { - enable = true; - plugins = [ "git" "sudo" ]; - theme = "gentoo"; - }; - }; - - # system packages - environment.systemPackages = with pkgs; [ - alacritty - btop - cowsay - dnsutils - efibootmgr - ethtool - file - ghostty - git - gnupg - iftop - imagemagick - imv - iotop - iperf3 - jq - kdePackages.qtmultimedia - kitty - ldns - lm_sensors - lsof - ltrace - mtr - neovim - nh - nix-output-monitor - nmap - nvd - p7zip - pciutils - sddm-astronaut - socat - strace - sysstat - tree - unzip - usbutils - vim - wget - which - xwayland-satellite - xz - zip - zstd + imports = [ + ../../modules/nixos/audio.nix + ../../modules/nixos/bootloader.nix + ../../modules/nixos/compositor.nix + ../../modules/nixos/gnupg.nix + ../../modules/nixos/locales.nix + ../../modules/nixos/networking.nix + ../../modules/nixos/noctalia.nix + ../../modules/nixos/openssh.nix + ../../modules/nixos/packages.nix + ../../modules/nixos/sddm.nix + ../../modules/nixos/services.nix + ../../modules/nixos/settings.nix + ../../modules/nixos/steam.nix + ../../modules/nixos/users.nix ]; - # Some programs need SUID wrappers - programs.mtr.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - # enable steam on this machine - nixpkgs.config.allowUnfree = true; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - }; - - # fix black screen in steam on xwayland-satellite - programs.steam.package = pkgs.steam.override { - extraArgs = "-system-composer"; - }; - - # enable the OpenSSH daemon - services.openssh = { - enable = true; - openFirewall = true; - }; - - # firewall configs - networking.firewall.allowedTCPPorts = [ ]; - networking.firewall.allowedUDPPorts = [ ]; - - # enable home-manager globally - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.backupFileExtension = "backup"; - - # add flake env variable for nh - environment.sessionVariables = { - NH_FLAKE = "/home/aaron/git/nixconfig"; - }; - # install state version system.stateVersion = "25.11"; # Don't change } diff --git a/modules/home-manager/git.nix b/modules/home-manager/git.nix new file mode 100644 index 0000000..db23f88 --- /dev/null +++ b/modules/home-manager/git.nix @@ -0,0 +1,18 @@ +{ config, pkgs, inputs, ... }: + +{ + programs.git = { + enable = true; + settings = { + push = { autoSetupRemote = true; }; + user = { + name = "aaron"; + email = "aaron@0x29a.ch"; + }; + }; + signing = { + key = "7A830180A05DAC59CDE43B0677D2F5DB48184456"; + signByDefault = true; + }; + }; +} diff --git a/modules/home-manager/nixvim.nix b/modules/home-manager/nixvim.nix new file mode 100644 index 0000000..0d4007d --- /dev/null +++ b/modules/home-manager/nixvim.nix @@ -0,0 +1,26 @@ +{ config, pkgs, inputs, ... }: + +{ + programs.nixvim = { + globals.mapleader = " "; + enable = true; + viAlias = false; + vimAlias = true; + opts = { + number = true; + relativenumber = true; + shiftwidth = 2; + tabstop = 2; + expandtab = true; + incsearch = true; + }; + colorschemes.nord.enable = true; + plugins.lualine.enable = true; + plugins.nix.enable = true; + plugins.nvim-tree.enable = true; + plugins.treesitter.enable = true; + plugins.telescope.enable = true; + plugins.web-devicons.enable = true; + plugins.indent-blankline.enable = true; + }; +} diff --git a/modules/home-manager/programs.nix b/modules/home-manager/programs.nix new file mode 100644 index 0000000..c592d55 --- /dev/null +++ b/modules/home-manager/programs.nix @@ -0,0 +1,18 @@ +{ config, pkgs, inputs, ... }: + +{ + # user packages + home.packages = with pkgs; [ + discord + fastfetch + keepassxc + nerd-fonts.sauce-code-pro + powerline-fonts + powerline-symbols + screenfetch + ]; + + # services and other software + services.syncthing.enable = true; + programs.home-manager.enable = true; +} diff --git a/modules/home-manager/shell.nix b/modules/home-manager/shell.nix new file mode 100644 index 0000000..4ca04ec --- /dev/null +++ b/modules/home-manager/shell.nix @@ -0,0 +1,20 @@ +{ config, pkgs, inputs, ... }: + +{ + programs.zsh = { + enable = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + oh-my-zsh = { + enable = true; + theme = "agnoster"; + #plugins = [ "git" "ssh-agent" ]; + }; + }; + + # set important env vars + home.sessionVariables = { + EDITOR = "vim"; + NH_FLAKE = "/home/aaron/git/nixconfig"; + }; +} diff --git a/modules/home-manager/styling.nix b/modules/home-manager/styling.nix new file mode 100644 index 0000000..0c12744 --- /dev/null +++ b/modules/home-manager/styling.nix @@ -0,0 +1,30 @@ +{ config, pkgs, inputs, ... }: + +{ + # set gtk theme + gtk = { + enable = true; + theme = { + name = "Adwaita-dark"; + package = pkgs.gnome-themes-extra; + }; + gtk3.extraConfig.gtk-application-prefer-dark-theme = 1; + gtk4.extraConfig.gtk-application-prefer-dark-theme = 1; + }; + + # set qt theme + qt = { + enable = true; + platformTheme.name = "qt6"; + style = { + name = "adwaita-dark"; + package = pkgs.adwaita-qt; + }; + }; + + # ensure packages are installed + home.packages = with pkgs; [ + gnome-themes-extra + adwaita-qt + ]; +} diff --git a/hosts/neon/home.nix b/modules/home-manager/tmux.nix similarity index 53% rename from hosts/neon/home.nix rename to modules/home-manager/tmux.nix index 802fb2f..723bb6d 100644 --- a/hosts/neon/home.nix +++ b/modules/home-manager/tmux.nix @@ -1,44 +1,12 @@ { config, pkgs, inputs, ... }: { - # user config - home.username = "aaron"; - home.homeDirectory = "/home/aaron"; - - # nixvim config - programs.nixvim = { - globals.mapleader = " "; - enable = true; - viAlias = false; - vimAlias = true; - opts = { - number = true; - relativenumber = true; - shiftwidth = 2; - tabstop = 2; - expandtab = true; - incsearch = true; - }; - colorschemes.nord.enable = true; - plugins.lualine.enable = true; - plugins.nix.enable = true; - plugins.nvim-tree.enable = true; - plugins.treesitter.enable = true; - plugins.telescope.enable = true; - plugins.web-devicons.enable = true; - plugins.indent-blankline.enable = true; - }; - - # tmux config programs.tmux = { enable = true; - # Basic options prefix = "C-a"; keyMode = "vi"; mouse = true; - # Terminal settings terminal = "screen-256color"; - # Extra configuration extraConfig = '' # Status keys set -g status-keys vi @@ -85,67 +53,4 @@ set -g window-status-separator "" ''; }; - - # user packages - home.packages = with pkgs; [ - discord - fastfetch - keepassxc - nerd-fonts.sauce-code-pro - powerline-fonts - powerline-symbols - screenfetch - ]; - - # configure git - programs.git.settings = { - enable = true; - userName = "aaron"; - userEmail = "aaron@0x29a.ch"; - }; - - # configure zsh theme - programs.zsh = { - enable = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - oh-my-zsh = { - enable = true; - theme = "agnoster"; - #plugins = [ "git" "ssh-agent" ]; - }; - }; - - # set gtk theme - gtk = { - enable = true; - theme = { - name = "Adwaita-dark"; - package = pkgs.gnome-themes-extra; - }; - gtk3.extraConfig.gtk-application-prefer-dark-theme = 1; - gtk4.extraConfig.gtk-application-prefer-dark-theme = 1; - }; - - # set qt theme - qt = { - enable = true; - platformTheme.name = "qt6"; - style = { - name = "adwaita-dark"; - package = pkgs.adwaita-qt; - }; - }; - - # set env vars - home.sessionVariables = { - EDITOR = "vim"; - }; - - # enable syncthing for user - services.syncthing.enable = true; - # enable home manager - programs.home-manager.enable = true; - # don't change - home.stateVersion = "25.11"; } diff --git a/modules/nixos/audio.nix b/modules/nixos/audio.nix new file mode 100644 index 0000000..99627e2 --- /dev/null +++ b/modules/nixos/audio.nix @@ -0,0 +1,9 @@ +{ config, lib, pkgs, ... }: + +{ + # enable sound through pipewire + services.pipewire = { + enable = true; + pulse.enable = true; + }; +} diff --git a/modules/nixos/bootloader.nix b/modules/nixos/bootloader.nix new file mode 100644 index 0000000..f77c457 --- /dev/null +++ b/modules/nixos/bootloader.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: + +{ + # set bootloader to systemd + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + # enable systemd initrd + boot.initrd.systemd.enable = true; + + # plymouth + boot.plymouth = { + enable = true; + theme = "spinner"; + }; + + # kernel options + boot.kernelParams = [ "quiet" "loglevel=2" ]; + boot.kernelPackages = pkgs.linuxPackages_latest; + + # Add boot-related packages + environment.systemPackages = with pkgs; [ + efibootmgr + ]; +} diff --git a/modules/nixos/compositor.nix b/modules/nixos/compositor.nix new file mode 100644 index 0000000..844c002 --- /dev/null +++ b/modules/nixos/compositor.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, ... }: + +{ + # just enable and install niri + programs.niri.enable = true; + + # Add compositor-related packages + environment.systemPackages = with pkgs; [ + xwayland-satellite + ]; +} diff --git a/modules/nixos/gnupg.nix b/modules/nixos/gnupg.nix new file mode 100644 index 0000000..1e1f380 --- /dev/null +++ b/modules/nixos/gnupg.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +{ + # enable gnupg agent + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + pinentryPackage = pkgs.pinentry-curses; + }; + + environment.systemPackages = with pkgs; [ + gnupg + pinentry-curses + ]; +} diff --git a/modules/nixos/locales.nix b/modules/nixos/locales.nix new file mode 100644 index 0000000..5c91d2d --- /dev/null +++ b/modules/nixos/locales.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +{ + # set the time zone + time.timeZone = "Europe/Zurich"; + + # set internationalisation properties + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # set console font and keymap + console = { + font = "Lat2-Terminus16"; + keyMap = "de_CH-latin1"; + }; +} diff --git a/modules/nixos/networking.nix b/modules/nixos/networking.nix new file mode 100644 index 0000000..f82d1cb --- /dev/null +++ b/modules/nixos/networking.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: + +{ + # set hostnname + networking.hostName = "neon"; + + # user networkmanager + networking.networkmanager.enable = true; + + # firewall default configs + networking.firewall.allowedTCPPorts = [ ]; + networking.firewall.allowedUDPPorts = [ ]; + + # enable bluetooth + hardware.bluetooth.enable = true; + + # Add network-related packages + environment.systemPackages = with pkgs; [ + wireguard-tools + ]; +} diff --git a/hosts/neon/noctalia.nix b/modules/nixos/noctalia.nix similarity index 80% rename from hosts/neon/noctalia.nix rename to modules/nixos/noctalia.nix index 82c2382..f280cd8 100644 --- a/hosts/neon/noctalia.nix +++ b/modules/nixos/noctalia.nix @@ -1,10 +1,8 @@ -{ pkgs, inputs, ... }: +{ config, lib, pkgs, inputs, ... }: { # install noctalia and helper packages environment.systemPackages = with pkgs; [ inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default - #kdePackages.qt6ct - #nwg-look adw-gtk3 adwaita-qt adwaita-qt6 diff --git a/modules/nixos/openssh.nix b/modules/nixos/openssh.nix new file mode 100644 index 0000000..d6cf556 --- /dev/null +++ b/modules/nixos/openssh.nix @@ -0,0 +1,9 @@ +{ config, lib, pkgs, ... }: + +{ + # enable the openssh daemon + services.openssh = { + enable = true; + openFirewall = true; + }; +} diff --git a/modules/nixos/packages.nix b/modules/nixos/packages.nix new file mode 100644 index 0000000..cb7a0cf --- /dev/null +++ b/modules/nixos/packages.nix @@ -0,0 +1,49 @@ +{ config, lib, pkgs, ... }: + +{ + # system packges + environment.systemPackages = with pkgs; [ + alacritty + btop + cowsay + dnsutils + ethtool + file + ghostty + git + imagemagick + imv + iperf3 + jq + kdePackages.qtmultimedia + kitty + ldns + lm_sensors + lsof + ltrace + mtr + neovim + nh + nix-output-monitor + nmap + nvd + p7zip + pciutils + sddm-astronaut + socat + strace + sysstat + tree + unzip + usbutils + vim + wget + which + xz + zip + zstd + ]; + + # browser + programs.firefox.enable = true; +} diff --git a/modules/nixos/sddm.nix b/modules/nixos/sddm.nix new file mode 100644 index 0000000..8ca7b7f --- /dev/null +++ b/modules/nixos/sddm.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: + +{ + # enable sddm and use astronaut theme + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + autoNumlock = true; + enableHidpi = true; + theme = "sddm-astronaut-theme"; + settings = { + Theme = { + Current = "sddm-astronaut-theme"; + }; + }; + extraPackages = with pkgs; [ + sddm-astronaut + ]; + }; +} diff --git a/modules/nixos/services.nix b/modules/nixos/services.nix new file mode 100644 index 0000000..8933225 --- /dev/null +++ b/modules/nixos/services.nix @@ -0,0 +1,9 @@ +{ config, lib, pkgs, ... }: + +{ + # list of enabled services on the system + services = { + tuned.enable = true; + upower.enable = true; + }; +} diff --git a/modules/nixos/settings.nix b/modules/nixos/settings.nix new file mode 100644 index 0000000..b7b6102 --- /dev/null +++ b/modules/nixos/settings.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: + +{ + # use flakes and nix command + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # links /libexec from derivations to /run/current-system/sw + environment.pathsToLink = [ "/libexec" ]; + # set the default editor to vim + environment.variables.EDITOR = "vim"; + + # enable home-manager globally + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.backupFileExtension = "backup"; +} diff --git a/modules/nixos/steam.nix b/modules/nixos/steam.nix new file mode 100644 index 0000000..afb49e2 --- /dev/null +++ b/modules/nixos/steam.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: + +{ + # allow unfree to install steam + nixpkgs.config.allowUnfree = true; + + # enable steam and open firewall + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; + + # fix black screen in steam when using xwayland-satellite + programs.steam.package = pkgs.steam.override { + extraArgs = "-system-composer"; + }; +} diff --git a/modules/nixos/users.nix b/modules/nixos/users.nix new file mode 100644 index 0000000..ea8630d --- /dev/null +++ b/modules/nixos/users.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +{ + # create users + users.users.aaron = { + isNormalUser = true; + group = "users"; + extraGroups = [ "wheel" "networkmanager" ]; + shell = pkgs.zsh; + }; + + # add default zsh config + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestions.enable = true; + ohMyZsh = { + enable = true; + plugins = [ "git" "sudo" ]; + theme = "gentoo"; + }; + }; +} diff --git a/users/aaron/home.nix b/users/aaron/home.nix new file mode 100644 index 0000000..50bcb09 --- /dev/null +++ b/users/aaron/home.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ../../modules/home-manager/git.nix + ../../modules/home-manager/nixvim.nix + ../../modules/home-manager/programs.nix + ../../modules/home-manager/shell.nix + ../../modules/home-manager/styling.nix + ../../modules/home-manager/tmux.nix + ]; + + home = { + username = "aaron"; + homeDirectory = "/home/aaron"; + stateVersion = "25.11"; + }; +}