From f4e35e83efb0404676ac748094a01a4e291242f0 Mon Sep 17 00:00:00 2001 From: Nate Anderson Date: Sun, 7 Jan 2024 22:18:36 -0700 Subject: [PATCH] Added programs, updated gaming volume to mount on boot --- flake.lock | 21 +++++++++++ flake.nix | 11 +++++- modules/apps/firefox/firefox.nix | 2 +- modules/home-manager/home.nix | 1 + modules/sway/sway_conf.nix | 14 +++++++ modules/user/.main_user.nix.kak.pLou1v | 52 ++++++++++++++++++++++++++ nixos/default.nix | 3 ++ nixos/desktop_configuration.nix | 21 ++++++++++- nixos/hardware-configuration.nix | 7 +++- 9 files changed, 127 insertions(+), 5 deletions(-) create mode 100644 modules/user/.main_user.nix.kak.pLou1v diff --git a/flake.lock b/flake.lock index 50cfd9a..ae32161 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,26 @@ "type": "github" } }, + "nix-ld": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701153607, + "narHash": "sha256-h+odOVyiGmEERMECoFOj5P7FPiMR8IPRzroFA4sKivg=", + "owner": "Mic92", + "repo": "nix-ld", + "rev": "bf5aa84a713c31d95b4307e442e966d6c7fd7ae7", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-ld", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1702312524, @@ -70,6 +90,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "nix-ld": "nix-ld", "nixpkgs": "nixpkgs", "nixpkgs-stable": "nixpkgs-stable", "nur": "nur" diff --git a/flake.nix b/flake.nix index 33b790d..24d87b3 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,11 @@ nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11"; + nix-ld = { + url = "github:Mic92/nix-ld"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nur.url = "github:nix-community/NUR"; home-manager = { @@ -19,7 +24,7 @@ # }; }; - outputs = { self, nixpkgs, nixpkgs-stable, nur, home-manager, ... } @ inputs: + outputs = { self, nixpkgs, nixpkgs-stable, nix-ld, nur, home-manager, ... } @ inputs: let inherit (self) outputs; system = "x86_64-linux"; @@ -47,10 +52,12 @@ nixDesktop = nixpkgs.lib.nixosSystem { # Pass args to desktop configuration specialArgs = { - inherit inputs outputs userName hostName desktop timeZone gaming; + inherit inputs outputs userName hostName desktop timeZone gaming system; }; modules = [ ./nixos/desktop_configuration.nix + # Setup nix-ld + nix-ld.nixosModules.nix-ld # Setup home manager home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; diff --git a/modules/apps/firefox/firefox.nix b/modules/apps/firefox/firefox.nix index 0f4758b..caa26ad 100644 --- a/modules/apps/firefox/firefox.nix +++ b/modules/apps/firefox/firefox.nix @@ -30,7 +30,7 @@ in engines = { "Startpage" = { urls = [{ - template = "https://www.startpage.com/sp/search?query={searchTerms}"; + template = "https://www.startpage.com/do/mypage.pl?prfe=a1ffaae1a3f4dc133b6e11b3d611db561598fc16fbc43a22c2694805a5b4d46852c848cb54f3ccbc9cea0e8e83dab567d3abe2b350870e7781f8701d4558a1c988aced444d1e8d8a7b830563/search?query={searchTerms}"; }]; }; }; diff --git a/modules/home-manager/home.nix b/modules/home-manager/home.nix index 49407d2..f57b31c 100644 --- a/modules/home-manager/home.nix +++ b/modules/home-manager/home.nix @@ -24,6 +24,7 @@ # The home.packages option allows you to install Nix packages into your # environment. firefoxApp.enable = true; + fonts.fontconfig.enable = true; home.packages = with pkgs; [ # nur.repos.crazazy.js.eslint diff --git a/modules/sway/sway_conf.nix b/modules/sway/sway_conf.nix index bff4b8a..2ea88e0 100644 --- a/modules/sway/sway_conf.nix +++ b/modules/sway/sway_conf.nix @@ -70,6 +70,7 @@ swaylock swayidle wl-clipboard + wdisplays xdg-utils zsh # Fonts @@ -81,12 +82,25 @@ # ]) ]; + # Thunar config + programs.thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman + ]; + }; + programs.file-roller.enable = true; + programs.xfconf.enable = true; + programs.zsh.enable = true; programs.steam.enable = config.swaywm.installGaming; + ### ## Services ### + services.gvfs.enable = true; # thunar functionalities services.openssh.enable = true; services.dbus.enable = true; services.pipewire = { diff --git a/modules/user/.main_user.nix.kak.pLou1v b/modules/user/.main_user.nix.kak.pLou1v new file mode 100644 index 0000000..4cbfc69 --- /dev/null +++ b/modules/user/.main_user.nix.kak.pLou1v @@ -0,0 +1,52 @@ +{ lib, config, pkgs, ... }: + +let + cfg = config.main_user; +in +{ + options.main_user = { + enable = lib.mkEnableOption "enable user module"; + + isDesktopUser = lib.mkOption { + default = false; + example = true; + description = "Add additional user groups for desktop users"; + }; + + userName = lib.mkOption { + default = "mainuser"; + description = "username"; + }; + }; + + config = lib.mkIf cfg.enable { + users.users.${cfg.userName} = lib.mkMerge [ + { + isNormalUser = true; + initialPassword = "password"; + + description = "main user"; + shell = pkgs.zsh; + } + + (lib.mkIf (!cfg.isDesktopUser) { + extraGroups = [ + "wheel" + "networkmanager" + cfg.userName + ]; + }) + (lib.mkIf cfg.isDesktopUser { + extraGroups = [ + "wheel" + "networkmanager" + "corectrl" + cfg.userName + "video" + "audio" + # For android + "adbusers" + ]; + }) + ]; + }; diff --git a/nixos/default.nix b/nixos/default.nix index df062b4..0d14abd 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -19,6 +19,9 @@ "nix-command" "flakes" ]; + programs.nix-ld.enable = true; + + system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/nixos/desktop_configuration.nix b/nixos/desktop_configuration.nix index 4870d21..7e95f23 100644 --- a/nixos/desktop_configuration.nix +++ b/nixos/desktop_configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, inputs, outputs, pkgs, userName, hostName, desktop, timeZone, gaming, ... }: +{ config, lib, inputs, outputs, pkgs, userName, hostName, desktop, timeZone, gaming, system, ... }: let supportedDesktops = [ "sway" ]; @@ -28,6 +28,8 @@ in "nix-command" "flakes" ]; + # programs.nix-ld.dev.enable = true; + # nixpkgs.config.allowUnfree = true; # Use the systemd-boot EFI boot loader. @@ -50,7 +52,9 @@ in useNonFree = true; installGaming = gaming; systemPackages = with pkgs; [ + # # Dev Tools + # dbeaver cargo kakoune @@ -59,25 +63,36 @@ in docker-compose python310 nodejs_21 + zig ### LSP's rnix-lsp # Nix LSP + openscad-lsp nodePackages.typescript-language-server vscode-langservers-extracted # provides eslint, markdown, json, css, and html lsp rubyPackages.solargraph python310Packages.python-lsp-server + zls ### Misc # android-udev-rules # android-tools # sdkmanager + openscad + # # Productivity + # libreoffice + # # Gaming + # + mumble wine-wayland r2modman + # # Better Unix + # bat duf fd @@ -86,13 +101,17 @@ in ripgrep gtop + # # Photo / Video + # davinci-resolve-studio imv mpv gimp + # # Work + # slack ]; }; diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index f2a935a..31e746e 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -8,7 +8,7 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "uas" "sd_mod" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "uas" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; @@ -23,6 +23,11 @@ fsType = "vfat"; }; + fileSystems."/home/nate/Games" = + { device = "/dev/disk/by-uuid/d66b7920-2c29-400a-be51-0b3890ea63db"; + fsType = "ext4"; + }; + swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking