diff options
author | Jasper Ras <jras@hostnet.nl> | 2024-11-14 08:21:57 +0100 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2024-11-14 08:21:57 +0100 |
commit | c88cfb92e38ae7abfd7abb699a108dd3cd537b20 (patch) | |
tree | 512884a15e5ad395f25e4f38101004c787f412ff | |
parent | 4428f370dd343f21b839a1479a5f8ef4e605ebad (diff) |
modules -> config etc
-rw-r--r-- | config/shared.nix (renamed from modules/compositor.nix) | 56 | ||||
-rw-r--r-- | flake.nix | 12 | ||||
-rw-r--r-- | hosts/tarrel.nix | 6 | ||||
-rw-r--r-- | hosts/work.nix | 61 | ||||
-rw-r--r-- | modules/gaming.nix | 5 | ||||
-rw-r--r-- | modules/keyd.nix | 12 | ||||
-rw-r--r-- | modules/nix-settings.nix | 8 | ||||
-rw-r--r-- | modules/packages.nix | 11 | ||||
-rw-r--r-- | modules/services.nix | 9 | ||||
-rw-r--r-- | modules/sunshine.nix | 23 | ||||
-rw-r--r-- | modules/virt.nix | 7 |
11 files changed, 55 insertions, 155 deletions
diff --git a/modules/compositor.nix b/config/shared.nix index 8226842..b006572 100644 --- a/modules/compositor.nix +++ b/config/shared.nix @@ -1,22 +1,52 @@ -# https://wiki.nixos.org/wiki/Sway { inputs, pkgs, ... }: { - programs.hyprland = { - enable = true; - xwayland.enable = true; - package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; - portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; - }; - environment.systemPackages = with pkgs; [ - kitty # Required by Hyprland + kitty waybar rofi-wayland-unwrapped rofi-rbw-wayland + helix + alacritty + firefox + git ]; - services.gnome.gnome-keyring.enable = true; + nixpkgs.config.allowUnfree = true; + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + substituters = ["https://hyprland.cachix.org"]; + trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; + }; + programs.steam.enable = true; + programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + programs.hyprland = { + enable = true; + xwayland.enable = true; + package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + }; + + services.openssh.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + services.keyd = { + enable = true; + keyboards = { + default = { + ids = [ "*" ]; + settings.main.capslock = "overload(meta, esc)"; + }; + }; + }; services.greetd = { enable = true; settings = { @@ -26,6 +56,7 @@ }; }; }; + services.gnome.gnome-keyring.enable = true; systemd.user.services.kanshi = { description = "kanshi daemon"; @@ -38,4 +69,9 @@ ExecStart = ''${pkgs.kanshi}/bin/kanshi -c kanshi_config_file''; }; }; + + virtualisation.docker = { + enable = true; + enableOnBoot = true; + }; } @@ -16,13 +16,7 @@ channelsConfig.allowUnfree = true; - hostDefaults.modules = [ - ./modules/compositor.nix - ./modules/keyd.nix - ./modules/services.nix - ./modules/packages.nix - ./modules/nix-settings.nix - ]; + hostDefaults.modules = [ ./config/shared.nix ]; hosts.work.modules = [ home-manager.nixosModules.home-manager @@ -35,7 +29,6 @@ } ./hosts/work.nix - ./modules/gaming.nix ]; hosts.tarrel.modules = [ @@ -49,9 +42,6 @@ } ./hosts/tarrel.nix - ./modules/gaming.nix - ./modules/virt.nix - ./modules/sunshine.nix ]; }; } diff --git a/hosts/tarrel.nix b/hosts/tarrel.nix index 66279be..8247d12 100644 --- a/hosts/tarrel.nix +++ b/hosts/tarrel.nix @@ -79,6 +79,12 @@ enable = true; unifiPackage = pkgs.unifi8; }; + services.sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + }; # from: https://help.ui.com/hc/en-us/articles/218506997-Required-Ports-Reference # best put it in a var somewhere diff --git a/hosts/work.nix b/hosts/work.nix index db55f87..57e411c 100644 --- a/hosts/work.nix +++ b/hosts/work.nix @@ -1,38 +1,19 @@ -# 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, ... }: - { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration/work.nix - ]; + imports = [ ./hardware-configuration/work.nix ]; hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; - # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; networking.hostName = "work"; # Define your hostname. - # 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"; - - # Enable networking networking.networkmanager.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"; @@ -45,13 +26,11 @@ LC_TIME = "nl_NL.UTF-8"; }; - # Configure keymap in X11 services.xserver.xkb = { layout = "us"; variant = ""; }; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.jras = { isNormalUser = true; description = "Jasper Ras"; @@ -59,41 +38,5 @@ packages = with pkgs; [ git helix ]; }; - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget - ]; - - # 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; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # 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? - + system.stateVersion = "24.05"; # Do NOT change before reading configuration.nix } diff --git a/modules/gaming.nix b/modules/gaming.nix deleted file mode 100644 index 781e12e..0000000 --- a/modules/gaming.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, pkgs, ... }: - -{ - programs.steam.enable = true; -} diff --git a/modules/keyd.nix b/modules/keyd.nix deleted file mode 100644 index 6b4e79d..0000000 --- a/modules/keyd.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - services.keyd = { - enable = true; - keyboards = { - default = { - ids = [ "*" ]; - settings.main.capslock = "overload(meta, esc)"; - }; - }; - }; -} diff --git a/modules/nix-settings.nix b/modules/nix-settings.nix deleted file mode 100644 index 8db69ad..0000000 --- a/modules/nix-settings.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: -{ - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - substituters = ["https://hyprland.cachix.org"]; - trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; - }; -} diff --git a/modules/packages.nix b/modules/packages.nix deleted file mode 100644 index d557a94..0000000 --- a/modules/packages.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, ... }: -{ - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - helix - alacritty - firefox - git - ]; -} diff --git a/modules/services.nix b/modules/services.nix deleted file mode 100644 index ad4bfc5..0000000 --- a/modules/services.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; -} diff --git a/modules/sunshine.nix b/modules/sunshine.nix deleted file mode 100644 index 86e68f4..0000000 --- a/modules/sunshine.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ ... }: -{ - services.sunshine = { - enable = true; - autoStart = true; - capSysAdmin = true; - openFirewall = true; - # applications = { - # apps = [ - # { - # name = "Auto Desktop"; - # prep-cmd = [ - # { - # # do = "${pkgs.sway}/bin/swaymsg \"output DP-2 mode --custom \${SUNSHINE_CLIENT_WIDTH}x\${SUNSHINE_CLIENT_HEIGHT}@\${SUNSHINE_CLIENT_FPS}Hz\""; - # do = "${pkgs.zsh}/bin/zsh -c \"${pkgs.sway}/bin/swaymsg \"output DP-2 mode --custom 1920x1080@60Hz\"\""; - # undo = "${pkgs.sway}/bin/swaymsg \"output DP-2 mode 3440x1440\""; - # } - # ]; - # } - # ]; - # }; - }; -} diff --git a/modules/virt.nix b/modules/virt.nix deleted file mode 100644 index e378c80..0000000 --- a/modules/virt.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - virtualisation.docker = { - enable = true; - enableOnBoot = true; - }; -} |