diff options
Diffstat (limited to 'modules')
28 files changed, 2085 insertions, 1886 deletions
diff --git a/modules/computers/nixnode.nix b/modules/computers/nixnode.nix index 3cf6999..65400c2 100644 --- a/modules/computers/nixnode.nix +++ b/modules/computers/nixnode.nix @@ -1,347 +1,368 @@ { inputs, config, ... }: let - nixos = config.flake.modules.nixos; + nixos = config.flake.modules.nixos; in { - flake.nixosConfigurations.nixnode = inputs.nixpkgs.lib.nixosSystem { - modules = [ nixos.nixnode ]; - }; + flake.nixosConfigurations.nixnode = inputs.nixpkgs.lib.nixosSystem { + modules = [ nixos.nixnode ]; + }; - flake.modules.nixos.nixnode = - # Edit this configuration file to define what should be installed on - # your system. Help is available in the configuration.nix(5) man page, on - # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + flake.modules.nixos.nixnode = + # Edit this configuration file to define what should be installed on + # your system. Help is available in the configuration.nix(5) man page, on + # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). - { config, lib, pkgs, ... }: + { + config, + lib, + pkgs, + ... + }: - { - imports = - [ - nixos.teh-nix - nixos.linode - inputs.STK.nixosModules.default - inputs.sops.nixosModules.sops - inputs.nixos-mailserver.nixosModules.default - inputs.neodrive-website.nixosModules.default - ]; + { + imports = [ + nixos.teh-nix + nixos.linode + inputs.STK.nixosModules.default + inputs.sops.nixosModules.sops + inputs.nixos-mailserver.nixosModules.default + inputs.neodrive-website.nixosModules.default + ]; - teh-nix.nix.enable = true; + teh-nix.nix.enable = true; - # Use the GRUB 2 boot loader. - boot.loader.grub.enable = true; - # boot.loader.grub.efiSupport = true; - # boot.loader.grub.efiInstallAsRemovable = true; - # boot.loader.efi.efiSysMountPoint = "/boot/efi"; - # Define on which hard drive you want to install Grub. - # boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + # boot.loader.grub.efiSupport = true; + # boot.loader.grub.efiInstallAsRemovable = true; + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; + # Define on which hard drive you want to install Grub. + # boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only - networking.hostName = "nixnode"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + networking.hostName = "nixnode"; # Define your hostname. + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - # Set your time zone. - time.timeZone = "NZ"; + # Set your time zone. + time.timeZone = "NZ"; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Select internationalisation properties. - # i18n.defaultLocale = "en_US.UTF-8"; - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # useXkbConfcpfig = true; # use xkb.options in tty. - # }; + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # useXkbConfcpfig = true; # use xkb.options in tty. + # }; - # Enable the X11 windowing system. - # services.xserver.enable = true; + # Enable the X11 windowing system. + # services.xserver.enable = true; - security.sudo.wheelNeedsPassword = false; + security.sudo.wheelNeedsPassword = false; - sops.defaultSopsFile = ../../secrets/general.yaml; - sops.defaultSopsFormat = "yaml"; + sops.defaultSopsFile = ../../secrets/general.yaml; + sops.defaultSopsFormat = "yaml"; - sops.age.keyFile = "/home/boss/.config/sops/age/keys.txt"; + sops.age.keyFile = "/home/boss/.config/sops/age/keys.txt"; - sops.secrets = { - #"wg/nixy/pub" = { }; - "wg/nixnode/priv" = { }; - "acme/linode" = { - owner = "acme"; - mode = "440"; - }; - "mail/boss" = { }; - "nginx/dashboard-htpasswd" = { - owner = "nginx"; - mode = "400"; - }; - }; + sops.secrets = { + #"wg/nixy/pub" = { }; + "wg/nixnode/priv" = { }; + "acme/linode" = { + owner = "acme"; + mode = "440"; + }; + "mail/boss" = { }; + "nginx/dashboard-htpasswd" = { + owner = "nginx"; + mode = "400"; + }; + }; - networking.firewall = { - enable = true; - allowedTCPPorts = [ 80 443 ]; - allowedUDPPorts = [ 51820 ]; - }; + networking.firewall = { + enable = true; + allowedTCPPorts = [ + 80 + 443 + ]; + allowedUDPPorts = [ 51820 ]; + }; - security.acme.acceptTerms = true; - # security.acme.useRoot = true; - security.acme.defaults.email = "boss@tehbox.org"; - # security.acme.certs = { - # "tehbox.org" = - # { - # webroot = "/var/lib/acme/acme-challenge/"; - # email = "boss@tehbox.org"; - # extraDomainNames = (map (sub: sub + ".tehbox.org" ) [ "www" "git" ]); - # #dnsProvider = "linode"; - # # dnsResolver = "92.123.94.2"; - # # dnsPropagationCheck = false; - # #environmentFile = environmentFile; - # }; - # }; - users.groups.acme.members = [ "nginx" ]; + security.acme.acceptTerms = true; + # security.acme.useRoot = true; + security.acme.defaults.email = "boss@tehbox.org"; + # security.acme.certs = { + # "tehbox.org" = + # { + # webroot = "/var/lib/acme/acme-challenge/"; + # email = "boss@tehbox.org"; + # extraDomainNames = (map (sub: sub + ".tehbox.org" ) [ "www" "git" ]); + # #dnsProvider = "linode"; + # # dnsResolver = "92.123.94.2"; + # # dnsPropagationCheck = false; + # #environmentFile = environmentFile; + # }; + # }; + users.groups.acme.members = [ "nginx" ]; - # Wireguard - networking = { - nat = { - enable = true; - externalInterface = "eth0"; - internalInterfaces = [ "wg0" ]; - }; + # Wireguard + networking = { + nat = { + enable = true; + externalInterface = "eth0"; + internalInterfaces = [ "wg0" ]; + }; - wireguard.interfaces.wg0 = { - ips = [ "10.100.0.1/24" ]; - listenPort = 51820; + wireguard.interfaces.wg0 = { + ips = [ "10.100.0.1/24" ]; + listenPort = 51820; - postSetup = '' -${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE -''; - postShutdown = '' -${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE -''; + postSetup = '' + ${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE + ''; + postShutdown = '' + ${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE + ''; - privateKeyFile = config.sops.secrets."wg/nixnode/priv".path; + privateKeyFile = config.sops.secrets."wg/nixnode/priv".path; - peers = [ - { - name = "nixy"; - publicKey = "FMkFU9k+YeCvj48+WDVglySgoncbITqkS//o2e+TClY="; - allowedIPs = [ "10.100.0.2/32" ]; - } - ]; - }; - }; + peers = [ + { + name = "nixy"; + publicKey = "FMkFU9k+YeCvj48+WDVglySgoncbITqkS//o2e+TClY="; + allowedIPs = [ "10.100.0.2/32" ]; + } + ]; + }; + }; - services.nginx = { - enable = true; - # Log the vhost at the start of each line ("vcombined") so goaccess - # can split traffic by subdomain - commonHttpConfig = '' -log_format vcombined '$host:$server_port $remote_addr - $remote_user [$time_local] ' - '"$request" $status $body_bytes_sent ' - '"$http_referer" "$http_user_agent"'; -access_log /var/log/nginx/access.log vcombined; -''; - # virtualHosts.${config.mailserver.fqdn}.enableACME = true; - virtualHosts = { - "tehbox.org" = { - root = "${inputs.self.packages.x86_64-linux.teh-website}/srv/www"; - serverAliases = [ "www.tehbox.org" ]; - enableACME = true; - forceSSL = true; - }; - "files.tehbox.org" = { - root = "/srv/files"; - enableACME = true; - forceSSL = true; - }; - # "stk.lug.ac" = { - # root = "${inputs.self.packages.x86_64-linux.stk-installers}/srv/www"; - # enableACME = true; - # forceSSL = true; - # locations."/".extraConfig = "autoindex on;\n"; - # }; - "dashboard.tehbox.org" = { - root = "/var/lib/goaccess/html"; - basicAuthFile = config.sops.secrets."nginx/dashboard-htpasswd".path; - enableACME = true; - forceSSL = true; - }; - "_" = { - globalRedirect = "tehbox.org"; - }; - }; - }; + services.nginx = { + enable = true; + # Log the vhost at the start of each line ("vcombined") so goaccess + # can split traffic by subdomain + commonHttpConfig = '' + log_format vcombined '$host:$server_port $remote_addr - $remote_user [$time_local] ' + '"$request" $status $body_bytes_sent ' + '"$http_referer" "$http_user_agent"'; + access_log /var/log/nginx/access.log vcombined; + ''; + # virtualHosts.${config.mailserver.fqdn}.enableACME = true; + virtualHosts = { + "tehbox.org" = { + root = "${inputs.self.packages.x86_64-linux.teh-website}/srv/www"; + serverAliases = [ "www.tehbox.org" ]; + enableACME = true; + forceSSL = true; + }; + "files.tehbox.org" = { + root = "/srv/files"; + enableACME = true; + forceSSL = true; + }; + # "stk.lug.ac" = { + # root = "${inputs.self.packages.x86_64-linux.stk-installers}/srv/www"; + # enableACME = true; + # forceSSL = true; + # locations."/".extraConfig = "autoindex on;\n"; + # }; + "dashboard.tehbox.org" = { + root = "/var/lib/goaccess/html"; + basicAuthFile = config.sops.secrets."nginx/dashboard-htpasswd".path; + enableACME = true; + forceSSL = true; + }; + "_" = { + globalRedirect = "tehbox.org"; + }; + }; + }; - # Web traffic dashboard, rebuilt from the nginx access log every 10 minutes. - # --persist/--restore keep the totals in /var/lib/goaccess/db across log rotations. - systemd.services.goaccess-report = { - description = "Build goaccess report for dashboard.tehbox.org"; - serviceConfig = { - Type = "oneshot"; - User = "nginx"; - Group = "nginx"; - StateDirectory = [ "goaccess" "goaccess/db" "goaccess/html" ]; - }; - script = '' -${pkgs.goaccess}/bin/goaccess /var/log/nginx/access.log \ - --log-format=VCOMBINED \ - --num-tests=0 \ - --no-query-string \ - --persist --restore --db-path=/var/lib/goaccess/db \ - --html-report-title="tehbox.org traffic" \ - -o /var/lib/goaccess/html/index.html -''; - }; - systemd.timers.goaccess-report = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "*:0/10"; - Persistent = true; - }; - }; + # Web traffic dashboard, rebuilt from the nginx access log every 10 minutes. + # --persist/--restore keep the totals in /var/lib/goaccess/db across log rotations. + systemd.services.goaccess-report = { + description = "Build goaccess report for dashboard.tehbox.org"; + serviceConfig = { + Type = "oneshot"; + User = "nginx"; + Group = "nginx"; + StateDirectory = [ + "goaccess" + "goaccess/db" + "goaccess/html" + ]; + }; + script = '' + ${pkgs.goaccess}/bin/goaccess /var/log/nginx/access.log \ + --log-format=VCOMBINED \ + --num-tests=0 \ + --no-query-string \ + --persist --restore --db-path=/var/lib/goaccess/db \ + --html-report-title="tehbox.org traffic" \ + -o /var/lib/goaccess/html/index.html + ''; + }; + systemd.timers.goaccess-report = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "*:0/10"; + Persistent = true; + }; + }; - teh-nix.services.cgit = { - enable = true; - authorizedKeys = config.users.users.boss.openssh.authorizedKeys.keys; - authorizedUsers = [ "boss" ]; - domain = "git.tehbox.org"; - enableACME = true; - # useACMEHost = "tehbox.org"; - forceSSL = true; - # onlySSL = true; - }; + teh-nix.services.cgit = { + enable = true; + authorizedKeys = config.users.users.boss.openssh.authorizedKeys.keys; + authorizedUsers = [ "boss" ]; + domain = "git.tehbox.org"; + enableACME = true; + # useACMEHost = "tehbox.org"; + forceSSL = true; + # onlySSL = true; + }; - services.neodrive-website = { - enable = true; - domain = "neodrive.tehbox.org"; - }; + services.neodrive-website = { + enable = true; + domain = "neodrive.tehbox.org"; + }; - services.znc = { - enable = true; - mutable = true; - useLegacyConfig = false; - openFirewall = true; - config = { - SSLCertFile = "/var/lib/acme/tehbox.org/key.pem"; - LoadModule = [ "webadmin" ]; - User.boss = { - Admin = true; - Pass.password = { - Method = "sha256"; - Hash = "401e8fed9a3ab1f93047b7465fd7cc6b0ca5aaed6b1c0482f0f4331ebdca8647"; - Salt = "*F_-,pqOdiJi;p)JoMnm"; - }; - }; - User.komodo = { - Admin = false; - Pass.password = { - Method = "sha256"; - Hash = "2c624debe3e2672383346230b6acad82192e40df05666481f792a9dd97d935cc"; - Salt = "q9At0+KZvmofZil(3us1"; - }; - }; - }; - }; + services.znc = { + enable = true; + mutable = true; + useLegacyConfig = false; + openFirewall = true; + config = { + SSLCertFile = "/var/lib/acme/tehbox.org/key.pem"; + LoadModule = [ "webadmin" ]; + User.boss = { + Admin = true; + Pass.password = { + Method = "sha256"; + Hash = "401e8fed9a3ab1f93047b7465fd7cc6b0ca5aaed6b1c0482f0f4331ebdca8647"; + Salt = "*F_-,pqOdiJi;p)JoMnm"; + }; + }; + User.komodo = { + Admin = false; + Pass.password = { + Method = "sha256"; + Hash = "2c624debe3e2672383346230b6acad82192e40df05666481f792a9dd97d935cc"; + Salt = "q9At0+KZvmofZil(3us1"; + }; + }; + }; + }; - services.openssh = { - enable = true; - settings.PermitRootLogin = "no"; - settings.PasswordAuthentication = false; - }; + services.openssh = { + enable = true; + settings.PermitRootLogin = "no"; + settings.PasswordAuthentication = false; + }; - services.superTuxKarts = { - enable = true; - port = 2759; - package = pkgs.superTuxKart; - serverOptions = { - server-name = "LUG STK server"; - server-mode = 3; - server-difficulty = 3; - server-max-players = 16; - track-voting = false; - voting-timeout = 15; - private-server-password = "lug@uoa"; - motd = "Server for LUG@UoA\nChampionship coming soon!"; - live-spectate = true; - server-configurable = true; - }; - }; + services.superTuxKarts = { + enable = true; + port = 2759; + package = pkgs.superTuxKart; + serverOptions = { + server-name = "LUG STK server"; + server-mode = 3; + server-difficulty = 3; + server-max-players = 16; + track-voting = false; + voting-timeout = 15; + private-server-password = "lug@uoa"; + motd = "Server for LUG@UoA\nChampionship coming soon!"; + live-spectate = true; + server-configurable = true; + }; + }; - mailserver = { - enable = true; - stateVersion = 3; - fqdn = "tehbox.org"; - domains = [ "tehbox.org" ]; + mailserver = { + enable = true; + stateVersion = 3; + fqdn = "tehbox.org"; + domains = [ "tehbox.org" ]; - x509.useACMEHost = config.mailserver.fqdn; + x509.useACMEHost = config.mailserver.fqdn; - loginAccounts = { - "boss@tehbox.org" = { - hashedPasswordFile = config.sops.secrets."mail/boss".path; - aliases = ["postmaster@tehbox.org"]; - }; - }; + loginAccounts = { + "boss@tehbox.org" = { + hashedPasswordFile = config.sops.secrets."mail/boss".path; + aliases = [ "postmaster@tehbox.org" ]; + }; + }; - # certificateScheme = "acme"; - }; + # certificateScheme = "acme"; + }; - users.users.boss = { - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager"]; # Enable ‘sudo’ for the user. - home = "/home/boss"; - openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJOukEKExoF6vr3vciQN8pBdd4FtZtRzqIGFJrUvllOY boss@nixy" ]; - }; - users.groups.files.members = [ "boss" "nginx" ]; - users.groups.nginx.members = [ "nginx" "znc" ]; + users.users.boss = { + isNormalUser = true; + extraGroups = [ + "wheel" + "networkmanager" + ]; # Enable ‘sudo’ for the user. + home = "/home/boss"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJOukEKExoF6vr3vciQN8pBdd4FtZtRzqIGFJrUvllOY boss@nixy" + ]; + }; + users.groups.files.members = [ + "boss" + "nginx" + ]; + users.groups.nginx.members = [ + "nginx" + "znc" + ]; - environment.systemPackages = with pkgs; [ - vim - emacs - inetutils - mtr - sysstat - git - goaccess - inputs.self.packages.x86_64-linux.teh-website - # inputs.self.packages.x86_64-linux.stk-installers - ]; + environment.systemPackages = with pkgs; [ + vim + emacs + inetutils + mtr + sysstat + git + goaccess + inputs.self.packages.x86_64-linux.teh-website + # inputs.self.packages.x86_64-linux.stk-installers + ]; + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; + networking.usePredictableInterfaceNames = false; + networking.useDHCP = false; + networking.interfaces.eth0.useDHCP = true; - networking.usePredictableInterfaceNames = false; - networking.useDHCP = false; - networking.interfaces.eth0.useDHCP = true; + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = true; + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "25.05"; # Did you read the comment? - # This option defines the first version of NixOS you have installed on this particular machine, - # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. - # - # Most users should NEVER change this value after the initial install, for any reason, - # even if you've upgraded your system to a new NixOS release. - # - # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, - # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how - # to actually do that. - # - # This value being lower than the current NixOS release does NOT mean your system is - # out of date, out of support, or vulnerable. - # - # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, - # and migrated your data accordingly. - # - # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . - system.stateVersion = "25.05"; # Did you read the comment? - - }; + }; } diff --git a/modules/computers/nixy.nix b/modules/computers/nixy.nix index 95820f5..140c50f 100644 --- a/modules/computers/nixy.nix +++ b/modules/computers/nixy.nix @@ -1,343 +1,343 @@ { inputs, config, ... }: let - nixos = config.flake.modules.nixos; - hm = config.flake.modules.homeManager; + nixos = config.flake.modules.nixos; + hm = config.flake.modules.homeManager; in { - flake.nixosConfigurations.nixy = inputs.nixpkgs.lib.nixosSystem { - modules = [ nixos.nixy ]; - }; + flake.nixosConfigurations.nixy = inputs.nixpkgs.lib.nixosSystem { + modules = [ nixos.nixy ]; + }; - flake.modules.nixos.nixy = - # 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’). + flake.modules.nixos.nixy = + # 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 = - [ - nixos.teh-nix - nixos.my-pkgs - nixos.tuf - inputs.sops.nixosModules.sops - #inputs.spicetify-nix.nixosModules.default - inputs.home-manager.nixosModules.home-manager - inputs.stylix.nixosModules.stylix - ]; + { config, pkgs, ... }: + { + imports = [ + nixos.teh-nix + nixos.my-pkgs + nixos.tuf + inputs.sops.nixosModules.sops + #inputs.spicetify-nix.nixosModules.default + inputs.home-manager.nixosModules.home-manager + inputs.stylix.nixosModules.stylix + ]; - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.boss = hm.boss; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.boss = hm.boss; - teh-nix.nix.enable = true; - programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; [ - # stdenv.cc.cc - glib - glibc - nspr - nss - dbus - atk - cups - cairo - gtk3 - alsa-lib - expat - fontconfig - freetype - libgbm - libnotify - libsecret - libxkbcommon - mesa - pango - libX11 - libXcomposite - libXcursor - libXdamage - libXext - libXfixes - libXi - libXrandr - libXrender - libXtst - libxcb - ]; + teh-nix.nix.enable = true; + programs.nix-ld.enable = true; + programs.nix-ld.libraries = with pkgs; [ + # stdenv.cc.cc + glib + glibc + nspr + nss + dbus + atk + cups + cairo + gtk3 + alsa-lib + expat + fontconfig + freetype + libgbm + libnotify + libsecret + libxkbcommon + mesa + pango + libX11 + libXcomposite + libXcursor + libXdamage + libXext + libXfixes + libXi + libXrandr + libXrender + libXtst + libxcb + ]; - # Use the systemd-boot EFI boot loader. - boot = { - loader.grub.enable = true; - loader.grub.device = "nodev"; - loader.grub.efiSupport = true; - loader.grub.enableCryptodisk = true; - # loader.grub.useOSProber = true; - loader.efi.canTouchEfiVariables = true; - kernel.sysctl."kernel.sysrq" = 502; - plymouth.enable = true; - }; + # Use the systemd-boot EFI boot loader. + boot = { + loader.grub.enable = true; + loader.grub.device = "nodev"; + loader.grub.efiSupport = true; + loader.grub.enableCryptodisk = true; + # loader.grub.useOSProber = true; + loader.efi.canTouchEfiVariables = true; + kernel.sysctl."kernel.sysrq" = 502; + plymouth.enable = true; + }; + networking.hostName = "nixy"; # Define your hostname. + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - networking.hostName = "nixy"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + sops.defaultSopsFile = ../../secrets/general.yaml; + sops.defaultSopsFormat = "yaml"; - sops.defaultSopsFile = ../../secrets/general.yaml; - sops.defaultSopsFormat = "yaml"; + sops.age.keyFile = "/home/boss/.config/sops/age/keys.txt"; - sops.age.keyFile = "/home/boss/.config/sops/age/keys.txt"; + sops.secrets = { + #"wg/nixnode/pub" = { }; + "wg/nixy/priv" = { + restartUnits = [ "nm-file-secret-agent.service" ]; + group = "networkmanager"; + mode = "440"; + }; + }; - sops.secrets = { - #"wg/nixnode/pub" = { }; - "wg/nixy/priv" = { - restartUnits = [ "nm-file-secret-agent.service" ]; - group = "networkmanager"; - mode = "440"; - }; - }; + networking.firewall = { + allowedUDPPorts = [ 51820 ]; + allowedTCPPorts = [ 8081 ]; + }; + networking.networkmanager.ensureProfiles = { + profiles = { + wg-nixnode = { + connection = { + id = "wg-nixnode"; + autoconnect = "false"; + interface-name = "wg0"; + type = "wireguard"; + }; + ipv4 = { + address1 = "10.100.0.2/32"; + may-fail = "false"; + method = "manual"; + }; + ipv6 = { + method = "disabled"; + }; + wireguard = { + listen-port = "51820"; + private-key-flags = 1; + #private-key = "dummy"; + }; + proxy = { }; + "wireguard-peer./6bWy02DhOSjaeXk+ol5ATgEYDDJvL+mTO9SCNvfIUQ=" = { + allowed-ips = "0.0.0.0/0;"; + endpoint = "172.105.172.191:51820"; + persistent-keepalive = "25"; + }; + }; + }; + secrets.entries = [ + { + matchId = "wg-nixnode"; + matchType = "wireguard"; + matchSetting = "wireguard"; + key = "private-key"; + file = config.sops.secrets."wg/nixy/priv".path; + } + ]; + }; - networking.firewall = { - allowedUDPPorts = [ 51820 ]; - allowedTCPPorts = [ 8081 ]; - }; - networking.networkmanager.ensureProfiles = { - profiles = { - wg-nixnode = { - connection = { - id = "wg-nixnode"; - autoconnect = "false"; - interface-name = "wg0"; - type = "wireguard"; - }; - ipv4 = { - address1 = "10.100.0.2/32"; - may-fail = "false"; - method = "manual"; - }; - ipv6 = { - method = "disabled"; - }; - wireguard = { - listen-port = "51820"; - private-key-flags = 1; - #private-key = "dummy"; - }; - proxy = { }; - "wireguard-peer./6bWy02DhOSjaeXk+ol5ATgEYDDJvL+mTO9SCNvfIUQ=" = { - allowed-ips = "0.0.0.0/0;"; - endpoint = "172.105.172.191:51820"; - persistent-keepalive = "25"; - }; - }; - }; - secrets.entries = [ - { - matchId = "wg-nixnode"; - matchType = "wireguard"; - matchSetting = "wireguard"; - key = "private-key"; - file = config.sops.secrets."wg/nixy/priv".path; - } - ]; - }; + systemd.services."nm-file-secret-agent" = { + serviceConfig.User = "boss"; + }; - systemd.services."nm-file-secret-agent" = { - serviceConfig.User = "boss"; - }; + # Set your time zone. + time.timeZone = "NZ"; + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Set your time zone. - time.timeZone = "NZ"; + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + #keyMap = "us"; + #useXkbConfig = true; # use xkbOptions in tty. + }; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + teh-nix.xorg = { + enable = true; + }; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - #keyMap = "us"; - #useXkbConfig = true; # use xkbOptions in tty. - }; + programs.hyprland = { + enable = false; + #package = inputs.hyprland.packages.${pkgs.system}.hyprland; + #portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + }; - teh-nix.xorg = { - enable = true; - }; + security.pam.services.swaylock = { }; - programs.hyprland = { - enable = false; - #package = inputs.hyprland.packages.${pkgs.system}.hyprland; - #portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; - }; + # Enable CUPS to print documents. + services.printing.enable = true; + services.printing.drivers = with pkgs; [ + hplip + ]; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; - security.pam.services.swaylock = {}; + # Enable sound. + #sound.enable = true; + services.pipewire = { + enable = true; + alsa.enable = false; + alsa.support32Bit = false; + pulse.enable = true; + }; - # Enable CUPS to print documents. - services.printing.enable = true; - services.printing.drivers = with pkgs;[ - hplip - ]; - services.avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - }; + services.upower.enable = true; - # Enable sound. - #sound.enable = true; - services.pipewire = { - enable = true; - alsa.enable = false; - alsa.support32Bit = false; - pulse.enable = true; - }; + # Enable touchpad support (enabled default in most desktopManager). + security.rtkit.enable = true; + services.libinput = { + enable = true; + mouse = { + accelProfile = "flat"; + }; + }; - services.upower.enable = true; + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.boss = { + isNormalUser = true; + extraGroups = [ + "wheel" + "networkmanager" + "input" + "uinput" + ]; + }; - # Enable touchpad support (enabled default in most desktopManager). - security.rtkit.enable = true; - services.libinput = { - enable = true; - mouse = { - accelProfile = "flat"; - }; - }; + fonts.packages = with pkgs; [ + #(nerdfonts.override { fonts = [ "Cousine" ]; }) + nerd-fonts.cousine + ]; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.boss = { - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" "input" "uinput" ]; - }; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim + firefox + pfetch + fastfetch + pinentry-gtk2 + git + nm-file-secret-agent + deploy-rs + ]; + documentation.dev.enable = true; - fonts.packages = with pkgs; [ - #(nerdfonts.override { fonts = [ "Cousine" ]; }) - nerd-fonts.cousine - ]; + hardware.graphics.enable32Bit = true; + programs.steam = { + enable = true; + package = pkgs.steam.override { + extraEnv = { + __NV_PRIME_RENDER_OFFLOAD = 1; + __NV_PRIME_RENDER_OFFLOAD_PROVIDER = "NVIDIA-G0"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + __VK_LAYER_NV_optimus = "NVIDIA_only"; + }; + }; - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; - [ - vim - firefox - pfetch - fastfetch - pinentry-gtk2 - git - nm-file-secret-agent - deploy-rs - ]; - documentation.dev.enable = true; + extraCompatPackages = with pkgs; [ + proton-ge-bin + ]; + }; - hardware.graphics.enable32Bit = true; - programs.steam = { - enable = true; - package = pkgs.steam.override { - extraEnv = { - __NV_PRIME_RENDER_OFFLOAD=1; - __NV_PRIME_RENDER_OFFLOAD_PROVIDER="NVIDIA-G0"; - __GLX_VENDOR_LIBRARY_NAME="nvidia"; - __VK_LAYER_NV_optimus="NVIDIA_only"; - }; - }; + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + programs.gnupg = { + agent = { + enable = true; + pinentryPackage = pkgs.pinentry-gtk2; + }; + # enableSSHSupport = true; + }; - extraCompatPackages = with pkgs; [ - proton-ge-bin - ]; - }; + hardware.bluetooth.enable = true; # enables support for Bluetooth + hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot + services.blueman.enable = true; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - programs.gnupg = { - agent = { - enable = true; - pinentryPackage = pkgs.pinentry-gtk2; - }; - # enableSSHSupport = true; - }; + systemd.tmpfiles.rules = [ + "f /var/lib/systemd/linger/boss" # enables lingering + ]; - hardware.bluetooth.enable = true; # enables support for Bluetooth - hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot - services.blueman.enable = true; + # programs.dconf.enable = true; - systemd.tmpfiles.rules = [ - "f /var/lib/systemd/linger/boss" # enables lingering - ]; + services.ratbagd.enable = true; - # programs.dconf.enable = true; + # xdg.portal.enable = true; + # services.flatpak.enable = true; + stylix = { + enable = true; - services.ratbagd.enable = true; + base16Scheme = "${pkgs.base16-schemes}/share/themes/material-palenight.yaml"; - # xdg.portal.enable = true; - # services.flatpak.enable = true; + image = ../../wallpaper.png; + targets.grub.useWallpaper = true; - stylix = { - enable = true; + opacity = { + terminal = 0.8; + }; - base16Scheme = "${pkgs.base16-schemes}/share/themes/material-palenight.yaml"; + polarity = "dark"; - image = ../../wallpaper.png; - targets.grub.useWallpaper = true; + fonts = { + monospace = { + package = pkgs.nerd-fonts.cousine; + name = "Cousine Nerd Font Mono"; + }; - opacity = { - terminal = 0.8; - }; + serif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Serif"; + }; - polarity = "dark"; + sansSerif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Sans"; + }; - fonts = { - monospace = { - package = pkgs.nerd-fonts.cousine; - name = "Cousine Nerd Font Mono"; - }; + emoji = { + package = pkgs.noto-fonts-color-emoji; + name = "Noto Color Emoji"; + }; - serif = { - package = pkgs.dejavu_fonts; - name = "DejaVu Serif"; - }; + sizes = { + terminal = 10; + applications = 10; + desktop = 10; + popups = 10; + }; + }; - sansSerif = { - package = pkgs.dejavu_fonts; - name = "DejaVu Sans"; - }; + cursor = { + package = pkgs.nordzy-cursor-theme; + name = "Nordzy-cursors"; + size = 20; + }; + }; - emoji = { - package = pkgs.noto-fonts-color-emoji; - name = "Noto Color Emoji"; - }; + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; - sizes = { - terminal = 10; - applications = 10; - desktop = 10; - popups = 10; - }; - }; + # 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? - cursor = { - package = pkgs.nordzy-cursor-theme; - name = "Nordzy-cursors"; - size = 20; - }; - }; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = 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/modules/deploy.nix b/modules/deploy.nix index 7cda026..20188a3 100644 --- a/modules/deploy.nix +++ b/modules/deploy.nix @@ -1,30 +1,35 @@ { inputs, config, ... }: let - system = "x86_64-linux"; - pkgs = import inputs.nixpkgs { inherit system; }; - deployPkgs = import inputs.nixpkgs { - inherit system; - overlays = [ - inputs.deploy-rs.overlays.default # or deploy-rs.overlays.default - (self: super: { deploy-rs = { inherit (pkgs) deploy-rs; lib = super.deploy-rs.lib; }; }) - ]; - }; - deployCfg = config.flake.deploy; + system = "x86_64-linux"; + pkgs = import inputs.nixpkgs { inherit system; }; + deployPkgs = import inputs.nixpkgs { + inherit system; + overlays = [ + inputs.deploy-rs.overlays.default # or deploy-rs.overlays.default + (self: super: { + deploy-rs = { + inherit (pkgs) deploy-rs; + lib = super.deploy-rs.lib; + }; + }) + ]; + }; + deployCfg = config.flake.deploy; in { - flake.deploy.nodes.nixnode = { - hostname = "tehbox.org"; - profiles.system = { - user = "root"; - sshUser = "boss"; - interactiveSudo = true; - path = deployPkgs.deploy-rs.lib.activate.nixos config.flake.nixosConfigurations.nixnode; - }; - }; + flake.deploy.nodes.nixnode = { + hostname = "tehbox.org"; + profiles.system = { + user = "root"; + sshUser = "boss"; + interactiveSudo = true; + path = deployPkgs.deploy-rs.lib.activate.nixos config.flake.nixosConfigurations.nixnode; + }; + }; - perSystem = - { system, ... }: - { - checks = inputs.deploy-rs.lib.${system}.deployChecks deployCfg; - }; + perSystem = + { system, ... }: + { + checks = inputs.deploy-rs.lib.${system}.deployChecks deployCfg; + }; } diff --git a/modules/flake-parts.nix b/modules/flake-parts.nix index d7a467b..8a9e348 100644 --- a/modules/flake-parts.nix +++ b/modules/flake-parts.nix @@ -1,8 +1,8 @@ { inputs, ... }: { - imports = [ - inputs.flake-parts.flakeModules.modules - ]; + imports = [ + inputs.flake-parts.flakeModules.modules + ]; - systems = [ "x86_64-linux" ]; + systems = [ "x86_64-linux" ]; } diff --git a/modules/hardware-setups/linode.nix b/modules/hardware-setups/linode.nix index 506c262..69af70d 100644 --- a/modules/hardware-setups/linode.nix +++ b/modules/hardware-setups/linode.nix @@ -1,44 +1,55 @@ { ... }: { - flake.modules.nixos.linode = - { config, lib, pkgs, modulesPath, ... }: + flake.modules.nixos.linode = + { + config, + lib, + pkgs, + modulesPath, + ... + }: - { - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; + { + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = [ + "virtio_pci" + "virtio_scsi" + "ahci" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; - boot.kernelParams = [ "console=ttyS0,19200n8" ]; - boot.loader.grub.extraConfig = '' - serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1; - terminal_input serial; - terminal_output serial - ''; - boot.loader.grub.forceInstall = true; - boot.loader.grub.device = "nodev"; - boot.loader.timeout = 10; + boot.kernelParams = [ "console=ttyS0,19200n8" ]; + boot.loader.grub.extraConfig = '' + serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1; + terminal_input serial; + terminal_output serial + ''; + boot.loader.grub.forceInstall = true; + boot.loader.grub.device = "nodev"; + boot.loader.timeout = 10; - fileSystems."/" = - { device = "/dev/sda"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/sda"; + fsType = "ext4"; + }; - swapDevices = - [ { device = "/dev/sdb"; } - ]; + swapDevices = [ + { device = "/dev/sdb"; } + ]; - # 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.enp0s5.useDHCP = lib.mkDefault true; + # 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.enp0s5.useDHCP = lib.mkDefault true; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - }; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + }; } diff --git a/modules/hardware-setups/tuf.nix b/modules/hardware-setups/tuf.nix index c36a0df..c231b52 100644 --- a/modules/hardware-setups/tuf.nix +++ b/modules/hardware-setups/tuf.nix @@ -1,57 +1,76 @@ { ... }: { - flake.modules.nixos.tuf = - # 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, ... }: + flake.modules.nixos.tuf = + # 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") - ]; + { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ "dm-snapshot" "cryptd"]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - boot.initrd.luks.devices.cryptroot = { - device = "/dev/disk/by-uuid/18e2ffad-9ffb-4c3a-a82f-dd8098171427"; - preLVM = true; - }; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ + "dm-snapshot" + "cryptd" + ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + boot.initrd.luks.devices.cryptroot = { + device = "/dev/disk/by-uuid/18e2ffad-9ffb-4c3a-a82f-dd8098171427"; + preLVM = true; + }; - fileSystems."/" = - { device = "/dev/disk/by-uuid/db909240-4006-4ca8-a03a-3e3fc60cba17"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/db909240-4006-4ca8-a03a-3e3fc60cba17"; + fsType = "ext4"; + }; - fileSystems."/home" = - { device = "/dev/disk/by-uuid/9ef8fad1-08cb-4c7a-9db1-3a37097544b0"; - fsType = "ext4"; - neededForBoot = true; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/9ef8fad1-08cb-4c7a-9db1-3a37097544b0"; + fsType = "ext4"; + neededForBoot = true; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6FC0-9F1C"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/6FC0-9F1C"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/e1e972c8-3bb9-4131-a77f-fdea9f086a4d"; } - ]; + swapDevices = [ + { device = "/dev/disk/by-uuid/e1e972c8-3bb9-4131-a77f-fdea9f086a4d"; } + ]; - # 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.enp2s0.useDHCP = lib.mkDefault true; - # networking.interfaces.enp5s0f3u1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + # 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.enp2s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp5s0f3u1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - hardware.enableAllFirmware = true; - }; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.enableAllFirmware = true; + }; } diff --git a/modules/home-manager/YATwm/default.nix b/modules/home-manager/YATwm/default.nix index 587e929..869ae2a 100644 --- a/modules/home-manager/YATwm/default.nix +++ b/modules/home-manager/YATwm/default.nix @@ -1,117 +1,166 @@ { inputs, config, ... }: let - hm = config.flake.modules.homeManager; + hm = config.flake.modules.homeManager; in { - flake.modules.homeManager.YATwm = - { - pkgs, - lib, - ... - } : { - imports = [ - hm.polybar - hm.rofi - hm.kitty - inputs.YATwm.homeManagerModules.default - ]; - home.packages = with pkgs; [ - i3lock - xss-lock - networkmanagerapplet - flameshot - picom - nitrogen - pamixer - kitty - alacritty - ]; + flake.modules.homeManager.YATwm = + { + pkgs, + lib, + ... + }: + { + imports = [ + hm.polybar + hm.rofi + hm.kitty + inputs.YATwm.homeManagerModules.default + ]; + home.packages = with pkgs; [ + i3lock + xss-lock + networkmanagerapplet + flameshot + picom + nitrogen + pamixer + kitty + alacritty + ]; - xsession.windowManager.YATwm = { - enable = true; - package = inputs.YATwm.packages.x86_64-linux.YATwm; - useEmacsBinds = true; - quitKey = "C-s-g"; - swapMods = false; - keybinds = let - left = "h"; - right = "l"; - up = "k"; - down = "j"; - wsBind = key: ws: { - "s-${key}" = "changeWS ${ws}"; - "s-S-${key}" = "wToWS ${ws}"; - }; - wsBinds = workspaces: lib.attrsets.concatMapAttrs (key: ws: wsBind key ws) workspaces; - in { - # Important - "s-E" = "exit"; - "s-R" = "reload"; + xsession.windowManager.YATwm = { + enable = true; + package = inputs.YATwm.packages.x86_64-linux.YATwm; + useEmacsBinds = true; + quitKey = "C-s-g"; + swapMods = false; + keybinds = + let + left = "h"; + right = "l"; + up = "k"; + down = "j"; + wsBind = key: ws: { + "s-${key}" = "changeWS ${ws}"; + "s-S-${key}" = "wToWS ${ws}"; + }; + wsBinds = workspaces: lib.attrsets.concatMapAttrs (key: ws: wsBind key ws) workspaces; + in + { + # Important + "s-E" = "exit"; + "s-R" = "reload"; - # Directions - "s-${left}" = "focChange left"; - "s-${right}" = "focChange right"; - "s-${up}" = "focChange up"; - "s-${down}" = "focChange down"; + # Directions + "s-${left}" = "focChange left"; + "s-${right}" = "focChange right"; + "s-${up}" = "focChange up"; + "s-${down}" = "focChange down"; - # Tiling - "s-t" = "toggle"; - "s-f" = "fullscreen"; + # Tiling + "s-t" = "toggle"; + "s-f" = "fullscreen"; - # Application shortcuts - "s-d" = "bashSpawn rofi -i -show drun -disable-history"; - "s-D" = "bashSpawn prime-run rofi -i -show drun -disable-history"; - "s-g" = "bashSpawn ~/bin/rofi-passmenu"; - "s-RET" = "bashSpawn kitty"; - # "s-r k" = "spawn kitty"; - "s-c" = "spawn firefox"; - "s-S--" = "bashSpawn emacsclient -c"; - "s-S" = "spawn flameshot gui"; - "s-x" = "spawn loginctl lock-session"; - "s-X" = "bashSpawn loginctl lock-session && systemctl suspend"; - "s-Q" = "kill"; + # Application shortcuts + "s-d" = "bashSpawn rofi -i -show drun -disable-history"; + "s-D" = "bashSpawn prime-run rofi -i -show drun -disable-history"; + "s-g" = "bashSpawn ~/bin/rofi-passmenu"; + "s-RET" = "bashSpawn kitty"; + # "s-r k" = "spawn kitty"; + "s-c" = "spawn firefox"; + "s-S--" = "bashSpawn emacsclient -c"; + "s-S" = "spawn flameshot gui"; + "s-x" = "spawn loginctl lock-session"; + "s-X" = "bashSpawn loginctl lock-session && systemctl suspend"; + "s-Q" = "kill"; - # Sound - "s-[" = "spawn playerctl -p firefox play-pause"; - "s-]" = "spawn playerctl -p spotify play-pause"; + # Sound + "s-[" = "spawn playerctl -p firefox play-pause"; + "s-]" = "spawn playerctl -p spotify play-pause"; - # Special workspaces - "s-p s" = "changeWS 11"; - "s-S-p s" = "wToWS 11"; - } // - wsBinds { - "1" = "1"; - "2" = "2"; - "3" = "3"; - "4" = "4"; - "5" = "5"; - "6" = "6"; - "7" = "7"; - "8" = "8"; - "9" = "9"; - "0" = "10"; - }; - workspaces = [ - {name = "1: A";} - {name = "2: B";} - {name = "3: C";} - {name = "4: D";} - {name = "5: E";} - {name = "6: F"; monitorPriorities = [2 1];} - {name = "7: G"; monitorPriorities = [2 1];} - {name = "8: H"; monitorPriorities = [2 1];} - {name = "9: I"; monitorPriorities = [2 1];} - {name = "10: J"; monitorPriorities = [2 1];} - {name = "S"; monitorPriorities = [1];} - ]; - startup = [ - {command = "~/.config/polybar/launch.sh"; once = false;} - {command = "picom --legacy-backends -fD 3"; once = false;} - {command = "xss-lock --transfer-sleep-lock -- i3lock -eti ~/Documents/lockscreen.png --nofork"; bash = false;} - {command = "nitrogen --restore";} - {command = "nm-applet"; once = false; bash = false;} - ]; - #extraConfig = "bindmode normal\n" + (builtins.readFile ./config); - }; - }; + # Special workspaces + "s-p s" = "changeWS 11"; + "s-S-p s" = "wToWS 11"; + } + // wsBinds { + "1" = "1"; + "2" = "2"; + "3" = "3"; + "4" = "4"; + "5" = "5"; + "6" = "6"; + "7" = "7"; + "8" = "8"; + "9" = "9"; + "0" = "10"; + }; + workspaces = [ + { name = "1: A"; } + { name = "2: B"; } + { name = "3: C"; } + { name = "4: D"; } + { name = "5: E"; } + { + name = "6: F"; + monitorPriorities = [ + 2 + 1 + ]; + } + { + name = "7: G"; + monitorPriorities = [ + 2 + 1 + ]; + } + { + name = "8: H"; + monitorPriorities = [ + 2 + 1 + ]; + } + { + name = "9: I"; + monitorPriorities = [ + 2 + 1 + ]; + } + { + name = "10: J"; + monitorPriorities = [ + 2 + 1 + ]; + } + { + name = "S"; + monitorPriorities = [ 1 ]; + } + ]; + startup = [ + { + command = "~/.config/polybar/launch.sh"; + once = false; + } + { + command = "picom --legacy-backends -fD 3"; + once = false; + } + { + command = "xss-lock --transfer-sleep-lock -- i3lock -eti ~/Documents/lockscreen.png --nofork"; + bash = false; + } + { command = "nitrogen --restore"; } + { + command = "nm-applet"; + once = false; + bash = false; + } + ]; + #extraConfig = "bindmode normal\n" + (builtins.readFile ./config); + }; + }; } diff --git a/modules/home-manager/emacs/default.nix b/modules/home-manager/emacs/default.nix index c63e481..e5bf32b 100644 --- a/modules/home-manager/emacs/default.nix +++ b/modules/home-manager/emacs/default.nix @@ -1,39 +1,50 @@ { ... }: { - flake.modules.homeManager.emacs = - { pkgs, config, ... } : - let - tex = (pkgs.texlive.combine { - inherit (pkgs.texlive) scheme-medium - dvisvgm dvipng # for preview and export as html - # svg transparent - etoolbox - subfiles - enumitem - wrapfig amsmath ulem hyperref capt-of; - }); - myEmacs = (pkgs.emacsPackagesFor pkgs.emacs30).emacsWithPackages (epkgs: with epkgs; [ - # vterm - # ghostel - treesit-grammars.with-all-grammars - ]); - in - { - services.emacs = { - enable = true; - package = myEmacs; - }; + flake.modules.homeManager.emacs = + { pkgs, config, ... }: + let + tex = ( + pkgs.texlive.combine { + inherit (pkgs.texlive) + scheme-medium + dvisvgm + dvipng # for preview and export as html + # svg transparent + etoolbox + subfiles + enumitem + wrapfig + amsmath + ulem + hyperref + capt-of + ; + } + ); + myEmacs = (pkgs.emacsPackagesFor pkgs.emacs30).emacsWithPackages ( + epkgs: with epkgs; [ + # vterm + # ghostel + treesit-grammars.with-all-grammars + ] + ); + in + { + services.emacs = { + enable = true; + package = myEmacs; + }; - home.packages = with pkgs; [ - mu - emacsPackages.mu4e - isync - ispell - poppler-utils - tex - ghostscript - haskell-language-server - myEmacs - ]; - }; + home.packages = with pkgs; [ + mu + emacsPackages.mu4e + isync + ispell + poppler-utils + tex + ghostscript + haskell-language-server + myEmacs + ]; + }; } diff --git a/modules/home-manager/home.nix b/modules/home-manager/home.nix index 3f4eb02..ad0b2c6 100644 --- a/modules/home-manager/home.nix +++ b/modules/home-manager/home.nix @@ -1,217 +1,219 @@ { inputs, config, ... }: let - hm = config.flake.modules.homeManager; + hm = config.flake.modules.homeManager; in { - flake.modules.homeManager.boss = - { pkgs, lib, ... }: - let - claude-code-latest = pkgs.claude-code.override { - manifest = lib.importJSON ./claude-code-manifest-2.1.282.json; - }; - in - { + flake.modules.homeManager.boss = + { pkgs, lib, ... }: + let + claude-code-latest = pkgs.claude-code.override { + manifest = lib.importJSON ./claude-code-manifest-2.1.282.json; + }; + in + { - imports = [ - hm.bash - hm.emacs - #hm.hyprland - hm.i3 - # hm.YATwm - hm.kitty - inputs.spicetify-nix.homeManagerModules.default - inputs.nixcord.homeModules.nixcord - inputs.zen-browser.homeModules.twilight-official - #inputs.stylix.homeManagerModules.stylix - ]; + imports = [ + hm.bash + hm.emacs + #hm.hyprland + hm.i3 + # hm.YATwm + hm.kitty + inputs.spicetify-nix.homeManagerModules.default + inputs.nixcord.homeModules.nixcord + inputs.zen-browser.homeModules.twilight-official + #inputs.stylix.homeManagerModules.stylix + ]; - home = { - stateVersion = "24.05"; - username = "boss"; - homeDirectory = "/home/boss"; - }; + home = { + stateVersion = "24.05"; + username = "boss"; + homeDirectory = "/home/boss"; + }; - # The home.packages option allows you to install Nix packages into your - # environment. - # nixpkgs.config.allowUnfree = true; - home.packages = with pkgs; [ - feh - pass - # spotify - playerctl - libqalculate - libreoffice - hunspell - hunspellDicts.en_AU - logisim-evolution - thunderbird - xdotool - discord - # (discord.override { - # withOpenASAR = true; - # withVencord = true; - # }) - # vesktop - mumble - gimp - bottom - xfce.thunar - mpv - man-pages - man-pages-posix - # (inputs.plover-flake.packages.${system}.plover.with-plugins (ps: with ps;[ - # plover-dict-commands - # plover-console-ui - # plover-controller - # ])) - pavucontrol - unzip zip - appimage-run - # lunar-client - libnotify - xclip - (python3.withPackages (ps: with ps; [ - python-lsp-server - numpy - matplotlib - jupyter - jupytext - pandas - pydot - scikit-learn - nbdev - pillow - ])) - graphviz - alacritty - # nyxt - wireguard-tools - brightnessctl - # inputs.nil.packages.${system}.default - nil - #inputs.polymc.packages.${system}.default - jre8 - #inputs.zen-browser.packages."${system}".default - piper - qbittorrent - # sbcl - superTuxKart - typst - sops - ffmpeg - ghc - # hytale-launcher - # inputs.hytale-launcher.packages.${pkgs.system}.default - #adom - flatpak - deadlock-mod-manager - nh - claude-code-latest - inputs.claude-desktop.packages.${system}.claude-desktop - # openttd - ]; + # The home.packages option allows you to install Nix packages into your + # environment. + # nixpkgs.config.allowUnfree = true; + home.packages = with pkgs; [ + feh + pass + # spotify + playerctl + libqalculate + libreoffice + hunspell + hunspellDicts.en_AU + logisim-evolution + thunderbird + xdotool + discord + # (discord.override { + # withOpenASAR = true; + # withVencord = true; + # }) + # vesktop + mumble + gimp + bottom + xfce.thunar + mpv + man-pages + man-pages-posix + # (inputs.plover-flake.packages.${system}.plover.with-plugins (ps: with ps;[ + # plover-dict-commands + # plover-console-ui + # plover-controller + # ])) + pavucontrol + unzip + zip + appimage-run + # lunar-client + libnotify + xclip + (python3.withPackages ( + ps: with ps; [ + python-lsp-server + numpy + matplotlib + jupyter + jupytext + pandas + pydot + scikit-learn + nbdev + pillow + ] + )) + graphviz + alacritty + # nyxt + wireguard-tools + brightnessctl + # inputs.nil.packages.${system}.default + nil + #inputs.polymc.packages.${system}.default + jre8 + #inputs.zen-browser.packages."${system}".default + piper + qbittorrent + # sbcl + superTuxKart + typst + sops + ffmpeg + ghc + # hytale-launcher + # inputs.hytale-launcher.packages.${pkgs.system}.default + #adom + flatpak + deadlock-mod-manager + nh + claude-code-latest + inputs.claude-desktop.packages.${system}.claude-desktop + # openttd + ]; - nix = { - #package = pkgs.nix; - settings.experimental-features = [ "nix-command" "flakes" ]; - }; + nix = { + #package = pkgs.nix; + settings.experimental-features = [ + "nix-command" + "flakes" + ]; + }; - home.sessionVariables = { - EDITOR = "emacsclient -c"; - MAKEFLAGS = " -j16 "; - MOZ_ENABLE_WAYLAND = 1; - }; + home.sessionVariables = { + EDITOR = "emacsclient -c"; + MAKEFLAGS = " -j16 "; + MOZ_ENABLE_WAYLAND = 1; + }; + programs.home-manager.enable = true; - programs.home-manager.enable = true; + programs.direnv = { + enable = true; + enableBashIntegration = true; + nix-direnv.enable = true; + }; - programs.direnv = { - enable = true; - enableBashIntegration = true; - nix-direnv.enable = true; - }; + services.gpg-agent.enable = true; + services.gpg-agent.pinentry.package = pkgs.pinentry-gtk2; - services.gpg-agent.enable = true; - services.gpg-agent.pinentry.package = pkgs.pinentry-gtk2; + services.dunst = { + enable = true; + settings = { + global = { + follow = "keyboard"; + frame_width = 0; + }; + }; + }; - services.dunst = { - enable = true; - settings = { - global = { - follow = "keyboard"; - frame_width = 0; - }; - }; - }; + programs.obs-studio = { + enable = true; - programs.obs-studio = { - enable = true; + # optional Nvidia hardware acceleration + # package = ( + # pkgs.obs-studio.override { + # cudaSupport = true; + # } + # ); - # optional Nvidia hardware acceleration - # package = ( - # pkgs.obs-studio.override { - # cudaSupport = true; - # } - # ); + plugins = with pkgs.obs-studio-plugins; [ + obs-pipewire-audio-capture + input-overlay + ]; + }; - plugins = with pkgs.obs-studio-plugins; [ - obs-pipewire-audio-capture - input-overlay - ]; - }; + # services.easyeffects.enable = true; - # services.easyeffects.enable = true; + services.pass-secret-service.enable = true; + # Start with the X session rather than at boot, so it inherits DISPLAY/XAUTHORITY + # and gpg can show the GTK pinentry. Otherwise apps get logged out. + systemd.user.services.pass-secret-service = { + Unit.After = [ "graphical-session.target" ]; + Unit.PartOf = lib.mkForce [ "graphical-session.target" ]; + Install.WantedBy = lib.mkForce [ "graphical-session.target" ]; + }; - services.pass-secret-service.enable = true; - # Start with the X session rather than at boot, so it inherits DISPLAY/XAUTHORITY - # and gpg can show the GTK pinentry. Otherwise apps get logged out. - systemd.user.services.pass-secret-service = { - Unit.After = [ "graphical-session.target" ]; - Unit.PartOf = lib.mkForce [ "graphical-session.target" ]; - Install.WantedBy = lib.mkForce [ "graphical-session.target" ]; - }; + programs.firefox = { + enable = true; + }; + programs.zen-browser = { + enable = true; + setAsDefaultBrowser = true; + }; + # programs.nixcord = { + # enable = true; + # }; - programs.firefox = { - enable = true; - }; - programs.zen-browser = { - enable = true; - setAsDefaultBrowser = true; - }; + stylix.targets.spicetify.enable = true; + stylix.targets.firefox.profileNames = [ "default" ]; + stylix.targets.zen-browser.profileNames = [ "default" ]; + # stylix.targets.nixcord.enable = true; - # programs.nixcord = { - # enable = true; - # }; + programs.spicetify = + let + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; + in + { + enable = true; + spotifyLaunchFlags = "--disable-gpu --disable-software-rasterizer"; + enabledExtensions = with spicePkgs.extensions; [ + fullAppDisplay + powerBar + # addToQueueTop + loopyLoop + ]; + enabledCustomApps = with spicePkgs.apps; [ + newReleases + lyricsPlus + betterLibrary + ]; + # theme = spicePkgs.themes.nightlight; + }; - - stylix.targets.spicetify.enable = true; - stylix.targets.firefox.profileNames = [ "default"]; - stylix.targets.zen-browser.profileNames = [ "default" ]; - # stylix.targets.nixcord.enable = true; - - programs.spicetify = - let - spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; - in - { - enable = true; - spotifyLaunchFlags = "--disable-gpu --disable-software-rasterizer"; - enabledExtensions = with spicePkgs.extensions; [ - fullAppDisplay - powerBar - # addToQueueTop - loopyLoop - ]; - enabledCustomApps = with spicePkgs.apps; [ - newReleases - lyricsPlus - betterLibrary - ]; - # theme = spicePkgs.themes.nightlight; - }; - - - xsession.windowManager.command = lib.mkForce "$@"; - }; + xsession.windowManager.command = lib.mkForce "$@"; + }; } diff --git a/modules/home-manager/hyprland/default.nix b/modules/home-manager/hyprland/default.nix index e5f041e..6f77ee9 100644 --- a/modules/home-manager/hyprland/default.nix +++ b/modules/home-manager/hyprland/default.nix @@ -1,157 +1,176 @@ { inputs, config, ... }: let - hm = config.flake.modules.homeManager; + hm = config.flake.modules.homeManager; in { - flake.modules.homeManager.hyprland = - { - pkgs, - lib, - ... - }: - { - imports = [ - hm.rofi - hm.kitty - hm.waybar - hm.hyprpaper - ]; + flake.modules.homeManager.hyprland = + { + pkgs, + lib, + ... + }: + { + imports = [ + hm.rofi + hm.kitty + hm.waybar + hm.hyprpaper + ]; - home.file.".config/hypr/hyprlock.conf".source = ./hyprlock.conf; + home.file.".config/hypr/hyprlock.conf".source = ./hyprlock.conf; - wayland.windowManager.hyprland= { - enable = true; - xwayland.enable = true; - systemd.variables = ["--all"]; - #package = inputs.hyprland.packages.${pkgs.system}.hyprland; - #portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; - settings = { - "$mod" = "SUPER"; - exec-once = [ - "waybar" - "xss-lock --transfer-sleep-lock -- hyprlock" - "nm-applet" - "hyprpaper" - ]; - bind = - [ - "$mod, C, exec, firefox" - ", Print, exec, grimblast copy area" - "$mod, D, exec, rofi -i -show drun -disable-history" - "$mod Shift, E, exit" - "$mod, Return, exec, kitty" - "$mod, T, togglesplit" - "$mod Control, left, workspace, m-1" - "$mod Control, h, workspace, m-1" - "$mod Control, right, workspace, m+1" - "$mod Control, l, workspace, m+1" - "$mod, x, exec, hyprlock" - "$mod Shift, x, exec, hyprlock" - "$mod Shift, x, exec, systemctl suspend" - "$mod Shift, MINUS, exec, emacsclient -c" - "ALT, Tab, focusmonitor, +1" - "$mod, G, exec, bash /home/boss/bin/rofi-passmenu" - ", XF86AudioRaiseVolume, exec, pamixer -i 5" - ", XF86AudioLowerVolume, exec, pamixer -d 5" - "$mod Shift, Q, killactive" - "$mod, F, fullscreen" - "$mod Shift, space, togglefloating" - "$mod, mouse:272, movewindow" - ", XF86AudioPlay, exec, playerctl play-pause" - "$mod, bracketleft, exec, playerctl -p firefox play-pause" - "$mod, bracketright, exec, playerctl -p spotify play-pause" - "$mod Shift, S, exec spectacle -r" - ] - ++ ( - # workspaces - # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} - builtins.concatLists (builtins.genList ( - x: let - key = let - c = (x + 1) / 10; - in toString (x + 1 - (c * 10)); - in [ - "$mod, ${key}, workspace, ${toString (x + 1)}" - "$mod SHIFT, ${key}, movetoworkspace, ${toString (x + 1)}" - (lib.mkIf (x < 5) - "$mod Control, ${key}, workspace, ${toString (x + 6)}" - ) - "$mod Control, ${key}, workspace, ${toString (x + 1)}" - ] - ) - 10) - ) - ++ ( - builtins.map ( - x: "$mod, ${ builtins.elemAt x 0}, movefocus, ${builtins.elemAt x 1}\nbind=$mod Shift, ${builtins.elemAt x 0}, movewindow, ${builtins.elemAt x 1}" - ) - [ - ["h" "l"] - ["left" "l"] - ["j" "d"] - ["down" "d"] - ["k" "u"] - ["up" "u"] - ["l" "r"] - ["right" "r"] - ] - ); - monitor = - [ - "eDP-1, highrr, 0x0, 1" - "HDMI-A-1, highrr, 1920x0, 1" - ]; - workspace = - (builtins.genList - (x : "${toString (x + 1)},monitor:eDP-1") - 5 - ) - ++ (builtins.genList - (x : "${toString (x + 6)},monitor:HDMI-A-1") - 5 - ); + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + systemd.variables = [ "--all" ]; + #package = inputs.hyprland.packages.${pkgs.system}.hyprland; + #portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + settings = { + "$mod" = "SUPER"; + exec-once = [ + "waybar" + "xss-lock --transfer-sleep-lock -- hyprlock" + "nm-applet" + "hyprpaper" + ]; + bind = [ + "$mod, C, exec, firefox" + ", Print, exec, grimblast copy area" + "$mod, D, exec, rofi -i -show drun -disable-history" + "$mod Shift, E, exit" + "$mod, Return, exec, kitty" + "$mod, T, togglesplit" + "$mod Control, left, workspace, m-1" + "$mod Control, h, workspace, m-1" + "$mod Control, right, workspace, m+1" + "$mod Control, l, workspace, m+1" + "$mod, x, exec, hyprlock" + "$mod Shift, x, exec, hyprlock" + "$mod Shift, x, exec, systemctl suspend" + "$mod Shift, MINUS, exec, emacsclient -c" + "ALT, Tab, focusmonitor, +1" + "$mod, G, exec, bash /home/boss/bin/rofi-passmenu" + ", XF86AudioRaiseVolume, exec, pamixer -i 5" + ", XF86AudioLowerVolume, exec, pamixer -d 5" + "$mod Shift, Q, killactive" + "$mod, F, fullscreen" + "$mod Shift, space, togglefloating" + "$mod, mouse:272, movewindow" + ", XF86AudioPlay, exec, playerctl play-pause" + "$mod, bracketleft, exec, playerctl -p firefox play-pause" + "$mod, bracketright, exec, playerctl -p spotify play-pause" + "$mod Shift, S, exec spectacle -r" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + builtins.concatLists ( + builtins.genList ( + x: + let + key = + let + c = (x + 1) / 10; + in + toString (x + 1 - (c * 10)); + in + [ + "$mod, ${key}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${key}, movetoworkspace, ${toString (x + 1)}" + (lib.mkIf (x < 5) "$mod Control, ${key}, workspace, ${toString (x + 6)}") + "$mod Control, ${key}, workspace, ${toString (x + 1)}" + ] + ) 10 + ) + ) + ++ (builtins.map + ( + x: + "$mod, ${builtins.elemAt x 0}, movefocus, ${builtins.elemAt x 1}\nbind=$mod Shift, ${builtins.elemAt x 0}, movewindow, ${builtins.elemAt x 1}" + ) + [ + [ + "h" + "l" + ] + [ + "left" + "l" + ] + [ + "j" + "d" + ] + [ + "down" + "d" + ] + [ + "k" + "u" + ] + [ + "up" + "u" + ] + [ + "l" + "r" + ] + [ + "right" + "r" + ] + ] + ); + monitor = [ + "eDP-1, highrr, 0x0, 1" + "HDMI-A-1, highrr, 1920x0, 1" + ]; + workspace = + (builtins.genList (x: "${toString (x + 1)},monitor:eDP-1") 5) + ++ (builtins.genList (x: "${toString (x + 6)},monitor:HDMI-A-1") 5); + input = { + touchpad.natural_scroll = true; + #touchpad.scroll_factor = 0.5; + accel_profile = "flat"; + follow_mouse = true; + kb_options = "caps:super"; + #sensitivity = 0.00; + }; + decoration = { + rounding = 10; + drop_shadow = false; + }; + animation = [ + "workspaces,1,5,easeOutQuint,slide" + ]; + bezier = [ + "easeInOutCubic,0.65,0,0.35,1" + "easeOutQuint,0.22,1,0.36,1" + ]; + general = { + #"col.inactive_border" = "rgb(2f2e43)"; + #"col.active_border" = "rgb(ab47bc)"; + border_size = 2; + gaps_in = 6; + gaps_out = 12; + }; + windowrulev2 = [ + "opacity 0.8 override 0.8 override, title:Spotify$" + ]; + }; + }; - input = { - touchpad.natural_scroll = true; - #touchpad.scroll_factor = 0.5; - accel_profile = "flat"; - follow_mouse = true; - kb_options = "caps:super"; - #sensitivity = 0.00; - }; - decoration = { - rounding = 10; - drop_shadow = false; - }; - animation = [ - "workspaces,1,5,easeOutQuint,slide" - ]; - bezier = [ - "easeInOutCubic,0.65,0,0.35,1" - "easeOutQuint,0.22,1,0.36,1" - ]; - general = { - #"col.inactive_border" = "rgb(2f2e43)"; - #"col.active_border" = "rgb(ab47bc)"; - border_size = 2; - gaps_in = 6; - gaps_out = 12; - }; - windowrulev2 = [ - "opacity 0.8 override 0.8 override, title:Spotify$" - ]; - }; - }; - - home.packages = with pkgs; [ - ydotool - xss-lock - pamixer - grimblast - playerctl - libsForQt5.spectacle - inputs.hyprlock.packages.${system}.hyprlock - ]; - }; + home.packages = with pkgs; [ + ydotool + xss-lock + pamixer + grimblast + playerctl + libsForQt5.spectacle + inputs.hyprlock.packages.${system}.hyprlock + ]; + }; } diff --git a/modules/home-manager/hyprpaper/default.nix b/modules/home-manager/hyprpaper/default.nix index 4596331..bc7ca9a 100644 --- a/modules/home-manager/hyprpaper/default.nix +++ b/modules/home-manager/hyprpaper/default.nix @@ -1,14 +1,14 @@ { ... }: { - flake.modules.homeManager.hyprpaper = - { - pkgs, - ... - }: - { - #home.file.".config/hypr/hyprpaper.conf".source = ./hyprpaper.conf; - home.packages = with pkgs; [ - hyprpaper - ]; - }; + flake.modules.homeManager.hyprpaper = + { + pkgs, + ... + }: + { + #home.file.".config/hypr/hyprpaper.conf".source = ./hyprpaper.conf; + home.packages = with pkgs; [ + hyprpaper + ]; + }; } diff --git a/modules/home-manager/i3/default.nix b/modules/home-manager/i3/default.nix index 982aea1..757c7a9 100644 --- a/modules/home-manager/i3/default.nix +++ b/modules/home-manager/i3/default.nix @@ -1,49 +1,49 @@ { inputs, config, ... }: let - hm = config.flake.modules.homeManager; + hm = config.flake.modules.homeManager; in { - flake.modules.homeManager.i3 = - # let - # nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.11"; - # pkgs = import nixpkgs { config = {}; overlays = []; }; - # in - # { - # i3-commands = pkgs.callPackage ./i3-commands.nix { }; - # } + flake.modules.homeManager.i3 = + # let + # nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.11"; + # pkgs = import nixpkgs { config = {}; overlays = []; }; + # in + # { + # i3-commands = pkgs.callPackage ./i3-commands.nix { }; + # } - - { - config, - pkgs, - ... - } : { - imports = [ - hm.polybar - hm.rofi - hm.kitty - hm.picom - ]; - xsession.enable = true; - xsession.windowManager.i3 = { - enable = true; - package = pkgs.i3; - }; - xdg.configFile."i3/config".enable = false; - home.file.".config/i3/config" = { - source = ./config; - onChange = "${pkgs.i3}/bin/i3-msg restart"; - }; - home.packages = with pkgs; [ - i3lock - xss-lock - networkmanagerapplet - flameshot - picom - nitrogen - pamixer - inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.i3-commands - inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.rofi-passmenu - ]; - }; + { + config, + pkgs, + ... + }: + { + imports = [ + hm.polybar + hm.rofi + hm.kitty + hm.picom + ]; + xsession.enable = true; + xsession.windowManager.i3 = { + enable = true; + package = pkgs.i3; + }; + xdg.configFile."i3/config".enable = false; + home.file.".config/i3/config" = { + source = ./config; + onChange = "${pkgs.i3}/bin/i3-msg restart"; + }; + home.packages = with pkgs; [ + i3lock + xss-lock + networkmanagerapplet + flameshot + picom + nitrogen + pamixer + inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.i3-commands + inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.rofi-passmenu + ]; + }; } diff --git a/modules/home-manager/i3/i3-commands.nix b/modules/home-manager/i3/i3-commands.nix index d3df9a4..fdfafb3 100644 --- a/modules/home-manager/i3/i3-commands.nix +++ b/modules/home-manager/i3/i3-commands.nix @@ -1,28 +1,28 @@ { - perSystem = - { pkgs, ... }: - { - packages.i3-commands = pkgs.callPackage ( - { - stdenv, - lib - }: - stdenv.mkDerivation { - pname = "i3-commands"; - version = "0.0.1"; + perSystem = + { pkgs, ... }: + { + packages.i3-commands = pkgs.callPackage ( + { + stdenv, + lib, + }: + stdenv.mkDerivation { + pname = "i3-commands"; + version = "0.0.1"; - srcs = lib.cleanSourceWith { - src = ./scripts; - filter = path: type: baseNameOf path != "rofi-passmenu"; - }; + srcs = lib.cleanSourceWith { + src = ./scripts; + filter = path: type: baseNameOf path != "rofi-passmenu"; + }; - installPhase = '' - runHook preInstall - mkdir -p $out/bin - install -D -m 755 ./* $out/bin - runHook postInstall - ''; - } - ) { }; - }; + installPhase = '' + runHook preInstall + mkdir -p $out/bin + install -D -m 755 ./* $out/bin + runHook postInstall + ''; + } + ) { }; + }; } diff --git a/modules/home-manager/i3/rofi-passmenu.nix b/modules/home-manager/i3/rofi-passmenu.nix index 006fcb3..0cd60d2 100644 --- a/modules/home-manager/i3/rofi-passmenu.nix +++ b/modules/home-manager/i3/rofi-passmenu.nix @@ -1,80 +1,80 @@ { - perSystem = - { pkgs, ... }: - { - packages.rofi-passmenu = pkgs.callPackage ( - { - pkgs - }: + perSystem = + { pkgs, ... }: + { + packages.rofi-passmenu = pkgs.callPackage ( + { + pkgs, + }: - pkgs.writeShellApplication { - name = "rofi-passmenu"; + pkgs.writeShellApplication { + name = "rofi-passmenu"; - runtimeInputs = with pkgs; [ - pass - rofi - xclip - xdotool - gnugrep - gawk - coreutils - libnotify - ]; + runtimeInputs = with pkgs; [ + pass + rofi + xclip + xdotool + gnugrep + gawk + coreutils + libnotify + ]; - text = '' - #!/usr/bin/env bash + text = '' + #!/usr/bin/env bash - store_dir="''${PASSWORD_STORE_DIR:-$HOME/.password-store}" + store_dir="''${PASSWORD_STORE_DIR:-$HOME/.password-store}" - get_passwords() { - echo "[+] Add New Password" - if [ -d "$store_dir" ]; then - find "$store_dir" -name "*.gpg" | sort | while IFS= read -r file; do - pass="''${file#"$store_dir"/}" - echo "''${pass%.gpg}" - done - fi - } + get_passwords() { + echo "[+] Add New Password" + if [ -d "$store_dir" ]; then + find "$store_dir" -name "*.gpg" | sort | while IFS= read -r file; do + pass="''${file#"$store_dir"/}" + echo "''${pass%.gpg}" + done + fi + } - selected=$(get_passwords | rofi -dmenu -i -p "pass") - [[ -z "$selected" ]] && exit 0 + selected=$(get_passwords | rofi -dmenu -i -p "pass") + [[ -z "$selected" ]] && exit 0 - if [[ "$selected" == "[+] Add New Password" ]]; then - new_path=$(rofi -dmenu -p "Enter path/name for new password:") - [[ -z "$new_path" ]] && exit 0 - - choice=$(echo -e "Generate\nManual" | rofi -dmenu -p "Password method:") - if [[ "$choice" == "Generate" ]]; then - pass generate "$new_path" 20 - notify-send "Pass" "Generated password for $new_path" - elif [[ "$choice" == "Manual" ]]; then - new_pass=$(rofi -dmenu -p "Enter password:" -password) - [[ -n "$new_pass" ]] && echo "$new_pass" | pass insert -m "$new_path" - fi - exit 0 - fi + if [[ "$selected" == "[+] Add New Password" ]]; then + new_path=$(rofi -dmenu -p "Enter path/name for new password:") + [[ -z "$new_path" ]] && exit 0 + + choice=$(echo -e "Generate\nManual" | rofi -dmenu -p "Password method:") + if [[ "$choice" == "Generate" ]]; then + pass generate "$new_path" 20 + notify-send "Pass" "Generated password for $new_path" + elif [[ "$choice" == "Manual" ]]; then + new_pass=$(rofi -dmenu -p "Enter password:" -password) + [[ -n "$new_pass" ]] && echo "$new_pass" | pass insert -m "$new_path" + fi + exit 0 + fi - action=$(echo -e "1. Type Password\n2. Type Username\n3. Copy Password\n4. Copy Username\n5. Show Password" | rofi -dmenu -i -p "$selected") + action=$(echo -e "1. Type Password\n2. Type Username\n3. Copy Password\n4. Copy Username\n5. Show Password" | rofi -dmenu -i -p "$selected") - case "$action" in - "1. Type Password") - pass show "$selected" | head -n 1 | tr -d '\n' | xdotool type --clearmodifiers -fi - - ;; - "2. Type Username") - pass show "$selected" | grep -i "^username:" | sed 's/^[^:]*:[[:space:]]*//' | tr -d '\n' | xdotool type --clearmodifiers -fi - - ;; - "3. Copy Password") - pass show -c "$selected" - ;; - "4. Copy Username") - pass show "$selected" | grep -i "^username:" | sed 's/^[^:]*:[[:space:]]*//' | xclip -selection clipboard - ;; - "5. Show Password") - pass show "$selected" | head -n 1 | rofi -dmenu -p "Password for $selected" - ;; - esac - ''; - } - ) { }; - }; + case "$action" in + "1. Type Password") + pass show "$selected" | head -n 1 | tr -d '\n' | xdotool type --clearmodifiers -fi - + ;; + "2. Type Username") + pass show "$selected" | grep -i "^username:" | sed 's/^[^:]*:[[:space:]]*//' | tr -d '\n' | xdotool type --clearmodifiers -fi - + ;; + "3. Copy Password") + pass show -c "$selected" + ;; + "4. Copy Username") + pass show "$selected" | grep -i "^username:" | sed 's/^[^:]*:[[:space:]]*//' | xclip -selection clipboard + ;; + "5. Show Password") + pass show "$selected" | head -n 1 | rofi -dmenu -p "Password for $selected" + ;; + esac + ''; + } + ) { }; + }; } diff --git a/modules/home-manager/kitty/default.nix b/modules/home-manager/kitty/default.nix index 8b1721f..d74217e 100644 --- a/modules/home-manager/kitty/default.nix +++ b/modules/home-manager/kitty/default.nix @@ -1,28 +1,28 @@ { ... }: { - flake.modules.homeManager.kitty = - { - pkgs, - config, - ... - }: - { - programs.kitty = { - enable = true; - keybindings = { - "control+shift+c" = "copy_to_clipboard"; - "control+shift+v" = "paste_from_clipboard"; - }; - settings = { - #font_family = "Cousine Nerd Font"; - #font_size = "10.0"; - #background_opacity = "0.8"; - term = "xterm-256color"; - enable_audio_bell = "no"; - mouse_hide_wait = 2; - window_padding_width = 4; - }; - #extraConfig = (builtins.readFile ./palenight.conf); - }; - }; + flake.modules.homeManager.kitty = + { + pkgs, + config, + ... + }: + { + programs.kitty = { + enable = true; + keybindings = { + "control+shift+c" = "copy_to_clipboard"; + "control+shift+v" = "paste_from_clipboard"; + }; + settings = { + #font_family = "Cousine Nerd Font"; + #font_size = "10.0"; + #background_opacity = "0.8"; + term = "xterm-256color"; + enable_audio_bell = "no"; + mouse_hide_wait = 2; + window_padding_width = 4; + }; + #extraConfig = (builtins.readFile ./palenight.conf); + }; + }; } diff --git a/modules/home-manager/picom/default.nix b/modules/home-manager/picom/default.nix index 3fb1cf7..5cabe2d 100644 --- a/modules/home-manager/picom/default.nix +++ b/modules/home-manager/picom/default.nix @@ -1,22 +1,22 @@ { ... }: { - flake.modules.homeManager.picom = - { - pkgs, - config, - ... - }: - { - services.picom = { - enable = true; - fade = true; - fadeDelta = 3; - fadeExclude = [ - "window_type *= 'tooltip'" - ]; - settings = { - corner-radius = 10; - }; - }; - }; + flake.modules.homeManager.picom = + { + pkgs, + config, + ... + }: + { + services.picom = { + enable = true; + fade = true; + fadeDelta = 3; + fadeExclude = [ + "window_type *= 'tooltip'" + ]; + settings = { + corner-radius = 10; + }; + }; + }; } diff --git a/modules/home-manager/polybar/default.nix b/modules/home-manager/polybar/default.nix index 101e8a8..4ed3e54 100644 --- a/modules/home-manager/polybar/default.nix +++ b/modules/home-manager/polybar/default.nix @@ -1,24 +1,25 @@ { ... }: { - flake.modules.homeManager.polybar = - { - config, - pkgs, - ... - } : { - home.file.".config/polybar/launch.sh" = { - source = ./launch.sh; - executable = true; - }; - home.file.".config/polybar/config.ini" = { - source = ./config.ini; - # onChange = '' - #${pkgs.procps}/bin/pkill polybar - #PATH=$PATH:${pkgs.polybarFull}/bin:${pkgs.lxrandr}/bin ~/.config/polybar/launch.sh - #''; - }; - home.packages = with pkgs; [ - polybarFull - ]; - }; + flake.modules.homeManager.polybar = + { + config, + pkgs, + ... + }: + { + home.file.".config/polybar/launch.sh" = { + source = ./launch.sh; + executable = true; + }; + home.file.".config/polybar/config.ini" = { + source = ./config.ini; + # onChange = '' + #${pkgs.procps}/bin/pkill polybar + #PATH=$PATH:${pkgs.polybarFull}/bin:${pkgs.lxrandr}/bin ~/.config/polybar/launch.sh + #''; + }; + home.packages = with pkgs; [ + polybarFull + ]; + }; } diff --git a/modules/home-manager/rofi/default.nix b/modules/home-manager/rofi/default.nix index 76cc56e..42e9857 100644 --- a/modules/home-manager/rofi/default.nix +++ b/modules/home-manager/rofi/default.nix @@ -1,17 +1,18 @@ { ... }: { - flake.modules.homeManager.rofi = - { - pkgs, - config, - ... - }: { - home.file.".config/rofi" = { - source = ./config; - recursive = true; - }; - home.packages = [ - pkgs.rofi - ]; - }; + flake.modules.homeManager.rofi = + { + pkgs, + config, + ... + }: + { + home.file.".config/rofi" = { + source = ./config; + recursive = true; + }; + home.packages = [ + pkgs.rofi + ]; + }; } diff --git a/modules/home-manager/shells/bash.nix b/modules/home-manager/shells/bash.nix index a396594..81eeae3 100644 --- a/modules/home-manager/shells/bash.nix +++ b/modules/home-manager/shells/bash.nix @@ -1,87 +1,87 @@ { ... }: { - flake.modules.homeManager.bash = - { pkgs, ... } : - { - programs.bash = { - enable = true; - enableCompletion = true; - initExtra = '' -tabs 4 -clear -PF_INFO="ascii title os kernel uptime memory shell wm" pfetch + flake.modules.homeManager.bash = + { pkgs, ... }: + { + programs.bash = { + enable = true; + enableCompletion = true; + initExtra = '' + tabs 4 + clear + PF_INFO="ascii title os kernel uptime memory shell wm" pfetch -# Fancy prompt -export PROMPT_COMMAND=__prompt_command -__prompt_command() { - local exit="$?" - PS1="" - local reset='\[\e[0m\]' - local white='\[\e[97m\]' - local blue='\[\e[38;5;25m\]' - local bgblue='\[\e[48;5;25m\]' - local green='\[\e[38;5;34m\]' - local bggreen='\[\e[48;5;34m\]' - local gray='\[\e[38;5;238m\]' - local bggray='\[\e[48;5;238m\]' - local red='\[\e[38;5;124m\]' - local bgred='\[\e[48;5;124m\]' + # Fancy prompt + export PROMPT_COMMAND=__prompt_command + __prompt_command() { + local exit="$?" + PS1="" + local reset='\[\e[0m\]' + local white='\[\e[97m\]' + local blue='\[\e[38;5;25m\]' + local bgblue='\[\e[48;5;25m\]' + local green='\[\e[38;5;34m\]' + local bggreen='\[\e[48;5;34m\]' + local gray='\[\e[38;5;238m\]' + local bggray='\[\e[48;5;238m\]' + local red='\[\e[38;5;124m\]' + local bgred='\[\e[48;5;124m\]' - # Add user - PS1+="$white$bgblue \u$blue" - # Add SHLVL (shell depth) - if [ $SHLVL -gt 2 ]; then - PS1+="$bggreen$white $(($SHLVL - 2))$reset$green" - fi - # Add dir - PS1+="$bggray$white \w$reset$gray" - - if [ $exit != 0 ]; then - # Change end color - #PS1+="$bgred$white \w$reset$red" - # Add exit code - PS1+="$bgred$white $exit$reset$red" - else - # Change end color - #PS1+="$bggray$white \w$reset$gray" - # Add end cap - PS1+="" - fi - PS1+="$reset " -} -# Powerline prompt -#export PS1='\[\e[48;5;25;38;5;189m\] \u \[\e[48;5;238;38;5;25m\] \[\e[48;5;238;38;5;189m\]\w \[\e[0m\]\[\e[38;5;238m\]\[\e[0m\] ' + # Add user + PS1+="$white$bgblue \u$blue" + # Add SHLVL (shell depth) + if [ $SHLVL -gt 2 ]; then + PS1+="$bggreen$white $(($SHLVL - 2))$reset$green" + fi + # Add dir + PS1+="$bggray$white \w$reset$gray" + + if [ $exit != 0 ]; then + # Change end color + #PS1+="$bgred$white \w$reset$red" + # Add exit code + PS1+="$bgred$white $exit$reset$red" + else + # Change end color + #PS1+="$bggray$white \w$reset$gray" + # Add end cap + PS1+="" + fi + PS1+="$reset " + } + # Powerline prompt + #export PS1='\[\e[48;5;25;38;5;189m\] \u \[\e[48;5;238;38;5;25m\] \[\e[48;5;238;38;5;189m\]\w \[\e[0m\]\[\e[38;5;238m\]\[\e[0m\] ' -# Multiline prompt -#export PS1="\[\e[32m\]╭──\[\e[31m\](\[\e[34m\]\u\[\e[33m\]@\[\e[34m\]\h\[\e[31m\])\[\e[32m\]-\[\e[31m\](\[\e[34m\]\w\[\e[31m\])\[\e[32m\]-\[\e[31m\](\[\e[34m\]\d\[\e[31m\]) -#\[\e[32m\]╰\[\e[0m\] " -''; - shellAliases = { - cm = "cmatrix -absu 2"; - pipes = "pipes.sh -KR -p 3 -t3 -c 1 -c 2 -c 3 -c 4 -c 5 -c 6"; - cl = "clear"; - ls = "lsd"; - la = "lsd -a"; - ll = "lsd -al"; - tree = "lsd --tree"; - pathfindsaver = "while sleep 1; do pathfind -f; done"; - qalc = "qalc -s 'varunits 0' -s 'angle 2'"; + # Multiline prompt + #export PS1="\[\e[32m\]╭──\[\e[31m\](\[\e[34m\]\u\[\e[33m\]@\[\e[34m\]\h\[\e[31m\])\[\e[32m\]-\[\e[31m\](\[\e[34m\]\w\[\e[31m\])\[\e[32m\]-\[\e[31m\](\[\e[34m\]\d\[\e[31m\]) + #\[\e[32m\]╰\[\e[0m\] " + ''; + shellAliases = { + cm = "cmatrix -absu 2"; + pipes = "pipes.sh -KR -p 3 -t3 -c 1 -c 2 -c 3 -c 4 -c 5 -c 6"; + cl = "clear"; + ls = "lsd"; + la = "lsd -a"; + ll = "lsd -al"; + tree = "lsd --tree"; + pathfindsaver = "while sleep 1; do pathfind -f; done"; + qalc = "qalc -s 'varunits 0' -s 'angle 2'"; - flake-rebuild = "nixos-rebuild switch --flake ~/nixos-configuration"; - }; - }; + flake-rebuild = "nixos-rebuild switch --flake ~/nixos-configuration"; + }; + }; - programs.zoxide = { - enable = true; - enableBashIntegration = true; - options = [ "--cmd cd" ]; - }; + programs.zoxide = { + enable = true; + enableBashIntegration = true; + options = [ "--cmd cd" ]; + }; - home.packages = with pkgs; [ - zoxide - pfetch - lsd - libqalculate - ]; - }; + home.packages = with pkgs; [ + zoxide + pfetch + lsd + libqalculate + ]; + }; } diff --git a/modules/home-manager/waybar/default.nix b/modules/home-manager/waybar/default.nix index fb084d7..684a020 100644 --- a/modules/home-manager/waybar/default.nix +++ b/modules/home-manager/waybar/default.nix @@ -1,20 +1,21 @@ { ... }: { - flake.modules.homeManager.waybar = - { - config, - pkgs, - ... - } : { - home.file.".config/waybar/" = { - source = ./config; - onChange = "${pkgs.procps}/bin/pkill waybar && ${pkgs.hyprland}/bin/hyprctl dispatch exec waybar || ${pkgs.hyprland}/bin/hyprctl dispatch exec waybar"; - recursive = true; - }; - home.packages = with pkgs; [ - waybar - pamixer - wtype - ]; - }; + flake.modules.homeManager.waybar = + { + config, + pkgs, + ... + }: + { + home.file.".config/waybar/" = { + source = ./config; + onChange = "${pkgs.procps}/bin/pkill waybar && ${pkgs.hyprland}/bin/hyprctl dispatch exec waybar || ${pkgs.hyprland}/bin/hyprctl dispatch exec waybar"; + recursive = true; + }; + home.packages = with pkgs; [ + waybar + pamixer + wtype + ]; + }; } diff --git a/modules/my-pkgs/adom.nix b/modules/my-pkgs/adom.nix index 0c2ad03..ebc2e77 100644 --- a/modules/my-pkgs/adom.nix +++ b/modules/my-pkgs/adom.nix @@ -1,59 +1,77 @@ { - perSystem = - { pkgs, ... }: - { - packages.adom = pkgs.callPackage ( - { stdenv, fetchurl, autoPatchelfHook, makeDesktopItem, makeWrapper, ncurses5, libtinfo, SDL2, SDL2_image, SDL2_mixer, SDL2_net, SDL2_ttf, luajit} : + perSystem = + { pkgs, ... }: + { + packages.adom = pkgs.callPackage ( + { + stdenv, + fetchurl, + autoPatchelfHook, + makeDesktopItem, + makeWrapper, + ncurses5, + libtinfo, + SDL2, + SDL2_image, + SDL2_mixer, + SDL2_net, + SDL2_ttf, + luajit, + }: - stdenv.mkDerivation rec { - pname = "adom"; - version = "3.3.3"; - src = fetchurl { - url = "https://sjc4.dl.dbolical.com/dl/2019/01/29/adom_noteye_linux_ubuntu_64_${version}.tar.gz?st=PcXL3PZSxDxr6H6v58PFfw==&e=1750223221"; - hash = "sha256-7c39tEPlrpWIL6QH0BIOLLrFFIlhEHPw5F3knMUh+BA="; - }; + stdenv.mkDerivation rec { + pname = "adom"; + version = "3.3.3"; + src = fetchurl { + url = "https://sjc4.dl.dbolical.com/dl/2019/01/29/adom_noteye_linux_ubuntu_64_${version}.tar.gz?st=PcXL3PZSxDxr6H6v58PFfw==&e=1750223221"; + hash = "sha256-7c39tEPlrpWIL6QH0BIOLLrFFIlhEHPw5F3knMUh+BA="; + }; - nativeBuildInputs = [ - autoPatchelfHook - makeWrapper - ]; + nativeBuildInputs = [ + autoPatchelfHook + makeWrapper + ]; - buildInputs = [ - (ncurses5.override { unicodeSupport = false; }) - ncurses5 - SDL2 - SDL2_image - SDL2_mixer - SDL2_net - SDL2_ttf - luajit - stdenv.cc.cc.lib - ]; + buildInputs = [ + (ncurses5.override { unicodeSupport = false; }) + ncurses5 + SDL2 + SDL2_image + SDL2_mixer + SDL2_net + SDL2_ttf + luajit + stdenv.cc.cc.lib + ]; - sourceRoot = "adom"; - installPhase = let desktopEntry = makeDesktopItem { - name = "adom"; - desktopName = "ADOM"; - exec = "OUT_DIR/bin/adom"; - #path = "OUT_DIR/share"; - }; in '' - runHook preInstall - install -m755 -D adom $out/bin/adom - wrapProgram $out/bin/adom \ - --chdir $out/share - install -m644 -D lib/libnoteye.so $out/lib/libnoteye.so - mkdir -p $out/share - cp -r common $out/share/ - cp -r docs $out/share/ - cp -r games $out/share/ - cp -r gfx $out/share/ - cp -r licenses $out/share/ - cp -r sound $out/share/ - mkdir -p $out/share/applications - sed -e "s|OUT_DIR|$out|g" ${desktopEntry}/share/applications/adom.desktop > $out/share/applications/adom.desktop - runHook postInstall -''; - } - ) { }; - }; + sourceRoot = "adom"; + installPhase = + let + desktopEntry = makeDesktopItem { + name = "adom"; + desktopName = "ADOM"; + exec = "OUT_DIR/bin/adom"; + #path = "OUT_DIR/share"; + }; + in + '' + runHook preInstall + install -m755 -D adom $out/bin/adom + wrapProgram $out/bin/adom \ + --chdir $out/share + install -m644 -D lib/libnoteye.so $out/lib/libnoteye.so + mkdir -p $out/share + cp -r common $out/share/ + cp -r docs $out/share/ + cp -r games $out/share/ + cp -r gfx $out/share/ + cp -r licenses $out/share/ + cp -r sound $out/share/ + mkdir -p $out/share/applications + sed -e "s|OUT_DIR|$out|g" ${desktopEntry}/share/applications/adom.desktop > $out/share/applications/adom.desktop + runHook postInstall + ''; + } + ) { }; + }; } diff --git a/modules/my-pkgs/default.nix b/modules/my-pkgs/default.nix index fb227d0..85ad44d 100644 --- a/modules/my-pkgs/default.nix +++ b/modules/my-pkgs/default.nix @@ -1,12 +1,17 @@ { inputs, ... }: { - flake.modules.nixos.my-pkgs = - { config, pkgs, lib, ... }: - { - nixpkgs.overlays = [ - (final: prev: { - adom = inputs.self.packages.${final.stdenv.hostPlatform.system}.adom; - }) - ]; - }; + flake.modules.nixos.my-pkgs = + { + config, + pkgs, + lib, + ... + }: + { + nixpkgs.overlays = [ + (final: prev: { + adom = inputs.self.packages.${final.stdenv.hostPlatform.system}.adom; + }) + ]; + }; } diff --git a/modules/my-pkgs/stk-installers.nix b/modules/my-pkgs/stk-installers.nix index 0558733..10eccd8 100644 --- a/modules/my-pkgs/stk-installers.nix +++ b/modules/my-pkgs/stk-installers.nix @@ -1,44 +1,60 @@ { - perSystem = - { pkgs, ... }: - { - packages.stk-installers = pkgs.callPackage ( - { stdenv, fetchurl, lib, writeText, ... }: - stdenv.mkDerivation rec { - pname = "stk-installers"; - version = "0.1.0"; + perSystem = + { pkgs, ... }: + { + packages.stk-installers = pkgs.callPackage ( + { + stdenv, + fetchurl, + lib, + writeText, + ... + }: + stdenv.mkDerivation rec { + pname = "stk-installers"; + version = "0.1.0"; - srcs = let - releaseHashes = { - #"installer-aarch64.exe" = "sha256-orLoDvW+fUDucqY4KcC0DQ4JbA2LaG3RQtaBEjtG6HU="; - #"installer-i686.exe" = "sha256-knC7XF6OeY/dQ2VnyjYm+IlJxU8g6s/S395Nr4HZ6Jk="; - # "installer-x86_64.exe" = "sha256-oSYOu3PdnaE+w+N/Um8p5JSztmwAwF/XB2ezCkSX2V4="; - # "linux-arm64.tar.gz" = "sha256-lhtLaRtEVHzcrae6OdrRVhpufnZskLIsot8foYqi5Hc="; - #"linux-armv7.tar.gz" = "sha256-jQYR2wkIu1j7c5xEfzdIa9fnQFU1wNKAVq35NZB/BzA="; - # "linux-x86.tar.gz" = "sha256-sT57jnRV7Wa4qC8p1/fOTwXfelM66fRckdfQvqMqOOs="; - "linux-x86_64.tar.gz" = "sha256-VwkLbCFj62kfIBBK6XEiBKy7ToNBBZ3uCl/1MV78QBs="; - # "mac-signed.zip" = "sha256-wmas24pjo/4w9SZS2bdJ9b66Sr655UOC+7k0sAxTswM="; - # "src.tar.gz" = "sha256-M8+IQeT/QILYC5JIAUKVu76mHRRoPobf8QDjq497J8s="; - # "win.zip" = "sha256-nffi1n6FYhJ6O7YzAw8b1O53+p5/CuEQiXRzAlr4rNw="; - }; - in - lib.attrsets.mapAttrsToList (release: hash: fetchurl { - url = "https://github.com/supertuxkart/stk-code/releases/download/1.5/SuperTuxKart-1.5-${release}"; - sha256 = hash; - }) releaseHashes - ++ [(writeText "hashes.txt" (builtins.concatStringsSep "\n" (lib.attrsets.mapAttrsToList (release: hash: "SuperTuxKart-1.5-${release} ${hash}") releaseHashes)))]; + srcs = + let + releaseHashes = { + #"installer-aarch64.exe" = "sha256-orLoDvW+fUDucqY4KcC0DQ4JbA2LaG3RQtaBEjtG6HU="; + #"installer-i686.exe" = "sha256-knC7XF6OeY/dQ2VnyjYm+IlJxU8g6s/S395Nr4HZ6Jk="; + # "installer-x86_64.exe" = "sha256-oSYOu3PdnaE+w+N/Um8p5JSztmwAwF/XB2ezCkSX2V4="; + # "linux-arm64.tar.gz" = "sha256-lhtLaRtEVHzcrae6OdrRVhpufnZskLIsot8foYqi5Hc="; + #"linux-armv7.tar.gz" = "sha256-jQYR2wkIu1j7c5xEfzdIa9fnQFU1wNKAVq35NZB/BzA="; + # "linux-x86.tar.gz" = "sha256-sT57jnRV7Wa4qC8p1/fOTwXfelM66fRckdfQvqMqOOs="; + "linux-x86_64.tar.gz" = "sha256-VwkLbCFj62kfIBBK6XEiBKy7ToNBBZ3uCl/1MV78QBs="; + # "mac-signed.zip" = "sha256-wmas24pjo/4w9SZS2bdJ9b66Sr655UOC+7k0sAxTswM="; + # "src.tar.gz" = "sha256-M8+IQeT/QILYC5JIAUKVu76mHRRoPobf8QDjq497J8s="; + # "win.zip" = "sha256-nffi1n6FYhJ6O7YzAw8b1O53+p5/CuEQiXRzAlr4rNw="; + }; + in + lib.attrsets.mapAttrsToList ( + release: hash: + fetchurl { + url = "https://github.com/supertuxkart/stk-code/releases/download/1.5/SuperTuxKart-1.5-${release}"; + sha256 = hash; + } + ) releaseHashes + ++ [ + (writeText "hashes.txt" ( + builtins.concatStringsSep "\n" ( + lib.attrsets.mapAttrsToList (release: hash: "SuperTuxKart-1.5-${release} ${hash}") releaseHashes + ) + )) + ]; - sourceRoot = "."; + sourceRoot = "."; - unpackPhase = ":"; + unpackPhase = ":"; - installPhase = '' -mkdir -p $out/srv/www -for srcFile in $srcs; do - cp $srcFile "$out/srv/www/$(stripHash $srcFile)" -done -''; - } - ) { }; - }; + installPhase = '' + mkdir -p $out/srv/www + for srcFile in $srcs; do + cp $srcFile "$out/srv/www/$(stripHash $srcFile)" + done + ''; + } + ) { }; + }; } diff --git a/modules/teh-nix/cgit.nix b/modules/teh-nix/cgit.nix index ff3aee0..0c2d8e5 100644 --- a/modules/teh-nix/cgit.nix +++ b/modules/teh-nix/cgit.nix @@ -1,161 +1,169 @@ { ... }: { - flake.modules.nixos.teh-nix = - { pkgs, lib, config, ... }: - let - cfg = config.teh-nix.services.cgit; - cgitrc = pkgs.writeText "cgitrc" '' -css=/static/cgit.css -logo=/static/cgit.png -favicon=/static/favicon.ico -repository-sort=age + flake.modules.nixos.teh-nix = + { + pkgs, + lib, + config, + ... + }: + let + cfg = config.teh-nix.services.cgit; + cgitrc = pkgs.writeText "cgitrc" '' + css=/static/cgit.css + logo=/static/cgit.png + favicon=/static/favicon.ico + repository-sort=age -root-title=${cfg.title} -root-desc=${cfg.description} + root-title=${cfg.title} + root-desc=${cfg.description} -enable-blame=1 -enable-commit-graph=1 -enable-log-filecount=1 -enable-log-linecount=1 -enable-index-links=1 + enable-blame=1 + enable-commit-graph=1 + enable-log-filecount=1 + enable-log-linecount=1 + enable-index-links=1 -snapshots=tar.gz zip -enable-http-clone=1 -clone-prefix=https://${cfg.domain} + snapshots=tar.gz zip + enable-http-clone=1 + clone-prefix=https://${cfg.domain} -readme=:README -readme=:readme -readme=:readme.txt -readme=:README.txt -readme=:readme.md -readme=:README.md + readme=:README + readme=:readme + readme=:readme.txt + readme=:README.txt + readme=:readme.md + readme=:README.md -${cfg.extraConfig} + ${cfg.extraConfig} -about-filter=${cfg.package}/lib/cgit/filters/about-formatting.sh -source-filter=${cfg.package}/lib/cgit/filters/syntax-highlighting.py + about-filter=${cfg.package}/lib/cgit/filters/about-formatting.sh + source-filter=${cfg.package}/lib/cgit/filters/syntax-highlighting.py -enable-git-config=1 -scan-path=${cfg.directory} -''; - in - { - options.teh-nix.services.cgit = with lib;{ - enable = mkEnableOption "Enable cgit"; - user = mkOption { - type = types.str; - default = "cgit"; - description = "Username for the user that will run cgit"; - }; - authorizedKeys = lib.mkOption { - type = types.listOf types.str; - default = [ ]; - description = "List of ssh keys for the cgit user (cgit user should own all repos)"; - }; - authorizedUsers = lib.mkOption { - type = types.listOf types.str; - default = [ ]; - description = "List of users that should have access to the cgit directory"; - }; - directory = mkOption { - type = types.str; - default = "/srv/cgit/repos"; - description = "Directory for cgit (cgit user's home directory"; - }; - description = mkOption { - type = types.str; - default = "Cgit instance hosted with nixos"; - description = "Description of the cgit website"; - }; - title = mkOption { - type = types.str; - default = "Cgit + Nix"; - description = "Title of the cgit website"; - }; - domain = mkOption { - type = types.str; - default = "git.example.com"; - description = "Domain to host it on"; - }; - useACMEHost = mkOption { - type = types.str; - default = ""; - description = "SSL cert to use if already aquired using security.acme.certs"; - }; - enableACME = mkEnableOption "Enable ACME with nginx"; - onlySSL = mkOption { - type = types.bool; - default = false; - description = "Only allow ssl connections"; - }; - forceSSL = mkOption { - type = types.bool; - default = true; - description = "Force ssl connections"; - }; - package = mkPackageOption pkgs "cgit" { }; - extraConfig = mkOption { - type = types.str; - default = ""; - description = "Extra config to be appended to cgitrc"; - }; - }; + enable-git-config=1 + scan-path=${cfg.directory} + ''; + in + { + options.teh-nix.services.cgit = with lib; { + enable = mkEnableOption "Enable cgit"; + user = mkOption { + type = types.str; + default = "cgit"; + description = "Username for the user that will run cgit"; + }; + authorizedKeys = lib.mkOption { + type = types.listOf types.str; + default = [ ]; + description = "List of ssh keys for the cgit user (cgit user should own all repos)"; + }; + authorizedUsers = lib.mkOption { + type = types.listOf types.str; + default = [ ]; + description = "List of users that should have access to the cgit directory"; + }; + directory = mkOption { + type = types.str; + default = "/srv/cgit/repos"; + description = "Directory for cgit (cgit user's home directory"; + }; + description = mkOption { + type = types.str; + default = "Cgit instance hosted with nixos"; + description = "Description of the cgit website"; + }; + title = mkOption { + type = types.str; + default = "Cgit + Nix"; + description = "Title of the cgit website"; + }; + domain = mkOption { + type = types.str; + default = "git.example.com"; + description = "Domain to host it on"; + }; + useACMEHost = mkOption { + type = types.str; + default = ""; + description = "SSL cert to use if already aquired using security.acme.certs"; + }; + enableACME = mkEnableOption "Enable ACME with nginx"; + onlySSL = mkOption { + type = types.bool; + default = false; + description = "Only allow ssl connections"; + }; + forceSSL = mkOption { + type = types.bool; + default = true; + description = "Force ssl connections"; + }; + package = mkPackageOption pkgs "cgit" { }; + extraConfig = mkOption { + type = types.str; + default = ""; + description = "Extra config to be appended to cgitrc"; + }; + }; - config = lib.mkIf cfg.enable { - environment.systemPackages = [ pkgs.git cfg.package ]; - users = { - groups.${cfg.user} = { - members = cfg.authorizedUsers; - }; - users.${cfg.user} = { - createHome = true; - homeMode = "770"; - home = cfg.directory; - isSystemUser = true; - shell = "${pkgs.git}/bin/git-shell"; - openssh.authorizedKeys.keys = cfg.authorizedKeys; - group = cfg.user; - }; - }; + config = lib.mkIf cfg.enable { + environment.systemPackages = [ + pkgs.git + cfg.package + ]; + users = { + groups.${cfg.user} = { + members = cfg.authorizedUsers; + }; + users.${cfg.user} = { + createHome = true; + homeMode = "770"; + home = cfg.directory; + isSystemUser = true; + shell = "${pkgs.git}/bin/git-shell"; + openssh.authorizedKeys.keys = cfg.authorizedKeys; + group = cfg.user; + }; + }; + services.fcgiwrap.instances.cgit = { + socket = { + user = cfg.user; + group = "nginx"; + type = "unix"; + mode = "0660"; + }; + process = { + user = cfg.user; + group = cfg.user; + }; + }; - services.fcgiwrap.instances.cgit = { - socket = { - user = cfg.user; - group = "nginx"; - type = "unix"; - mode = "0660"; - }; - process = { - user = cfg.user; - group = cfg.user; - }; - }; - - services.nginx.enable = true; - services.nginx.virtualHosts.${cfg.domain} = { - locations."~* ^/static/(.+.(ico|css|png))$" = { - extraConfig = '' -alias ${cfg.package}/cgit/$1; -''; - }; - locations."/" = { - extraConfig = '' -include ${pkgs.nginx}/conf/fastcgi_params; -fastcgi_param CGIT_CONFIG ${cgitrc}; -fastcgi_param SCRIPT_FILENAME ${cfg.package}/cgit/cgit.cgi; -fastcgi_split_path_info ^(/?)(.+)$; -fastcgi_param PATH_INFO $fastcgi_path_info; -fastcgi_param QUERY_STRING $args; -fastcgi_param HTTP_HOST $server_name; -fastcgi_pass unix:${config.services.fcgiwrap.instances.cgit.socket.address}; - ''; - }; - enableACME = cfg.enableACME; - forceSSL = cfg.forceSSL; - } // lib.optionalAttrs (cfg.useACMEHost != "") { - useACMEHost = "${cfg.useACMEHost}"; - }; - }; - }; + services.nginx.enable = true; + services.nginx.virtualHosts.${cfg.domain} = { + locations."~* ^/static/(.+.(ico|css|png))$" = { + extraConfig = '' + alias ${cfg.package}/cgit/$1; + ''; + }; + locations."/" = { + extraConfig = '' + include ${pkgs.nginx}/conf/fastcgi_params; + fastcgi_param CGIT_CONFIG ${cgitrc}; + fastcgi_param SCRIPT_FILENAME ${cfg.package}/cgit/cgit.cgi; + fastcgi_split_path_info ^(/?)(.+)$; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param QUERY_STRING $args; + fastcgi_param HTTP_HOST $server_name; + fastcgi_pass unix:${config.services.fcgiwrap.instances.cgit.socket.address}; + ''; + }; + enableACME = cfg.enableACME; + forceSSL = cfg.forceSSL; + } + // lib.optionalAttrs (cfg.useACMEHost != "") { + useACMEHost = "${cfg.useACMEHost}"; + }; + }; + }; } diff --git a/modules/teh-nix/nix.nix b/modules/teh-nix/nix.nix index d0b6cb3..dc6d414 100644 --- a/modules/teh-nix/nix.nix +++ b/modules/teh-nix/nix.nix @@ -1,45 +1,48 @@ { inputs, ... }: { - flake.modules.nixos.teh-nix = - { config, lib, ... }: - { - options.teh-nix.nix = with lib; { - enable = mkEnableOption "Use the TehNix nix settings"; - }; + flake.modules.nixos.teh-nix = + { config, lib, ... }: + { + options.teh-nix.nix = with lib; { + enable = mkEnableOption "Use the TehNix nix settings"; + }; - config = lib.mkIf config.teh-nix.nix.enable { - nix.nixPath = [ "/etc/nix/path" ]; - nix.registry.nixpkgs.flake = inputs.nixpkgs; - environment.etc."nix/path/nixpkgs".source = inputs.nixpkgs; + config = lib.mkIf config.teh-nix.nix.enable { + nix.nixPath = [ "/etc/nix/path" ]; + nix.registry.nixpkgs.flake = inputs.nixpkgs; + environment.etc."nix/path/nixpkgs".source = inputs.nixpkgs; - nix = { - settings = { - experimental-features = [ "nix-command" "flakes" ]; - auto-optimise-store = true; + nix = { + settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + auto-optimise-store = true; - trusted-users = [ "boss" ]; + trusted-users = [ "boss" ]; - substituters = [ - "https://cache.nixos.org" - ]; + substituters = [ + "https://cache.nixos.org" + ]; - # trusted-public-keys = [ - # "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - # ]; - }; - optimise.automatic = true; - }; + # trusted-public-keys = [ + # "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + # ]; + }; + optimise.automatic = true; + }; - # nh's cleaner replaces nix.gc (the nh module asserts they aren't both on) - programs.nh = { - enable = true; - clean = { - enable = true; - dates = "weekly"; - # --no-direnv keeps nix-direnv's gcroots so dev shells survive - extraArgs = "--keep-since 7d --keep 5 --no-direnv"; - }; - }; - }; - }; + # nh's cleaner replaces nix.gc (the nh module asserts they aren't both on) + programs.nh = { + enable = true; + clean = { + enable = true; + dates = "weekly"; + # --no-direnv keeps nix-direnv's gcroots so dev shells survive + extraArgs = "--keep-since 7d --keep 5 --no-direnv"; + }; + }; + }; + }; } diff --git a/modules/teh-nix/nvidia.nix b/modules/teh-nix/nvidia.nix index f14d20c..816de89 100644 --- a/modules/teh-nix/nvidia.nix +++ b/modules/teh-nix/nvidia.nix @@ -1,40 +1,45 @@ { ... }: { - flake.modules.nixos.teh-nix = - { config, pkgs, lib, ... }: - let - nvidia-offload = pkgs.writeShellScriptBin "prime-run" '' -export __NV_PRIME_RENDER_OFFLOAD=1 -export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 -export __GLX_VENDOR_LIBRARY_NAME=nvidia -export __VK_LAYER_NV_optimus=NVIDIA_only -exec "$@" -''; - in - { - options.teh-nix.nvidia = with lib; { - enable = mkEnableOption "Enable nvidia"; - }; + flake.modules.nixos.teh-nix = + { + config, + pkgs, + lib, + ... + }: + let + nvidia-offload = pkgs.writeShellScriptBin "prime-run" '' + export __NV_PRIME_RENDER_OFFLOAD=1 + export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 + export __GLX_VENDOR_LIBRARY_NAME=nvidia + export __VK_LAYER_NV_optimus=NVIDIA_only + exec "$@" + ''; + in + { + options.teh-nix.nvidia = with lib; { + enable = mkEnableOption "Enable nvidia"; + }; - config = lib.mkIf config.teh-nix.nvidia.enable { - nixpkgs.config.allowUnfree = true; - hardware.graphics.enable = true; - hardware.nvidia.modesetting.enable = true; - # hardware.nvidia.dynamicBoost.enable = true; - hardware.nvidia.open = true; - hardware.nvidia.prime = { - # sync.enable = true; - offload.enable = true; - # offload.offloadCmdMainProgram = "prime-run"; + config = lib.mkIf config.teh-nix.nvidia.enable { + nixpkgs.config.allowUnfree = true; + hardware.graphics.enable = true; + hardware.nvidia.modesetting.enable = true; + # hardware.nvidia.dynamicBoost.enable = true; + hardware.nvidia.open = true; + hardware.nvidia.prime = { + # sync.enable = true; + offload.enable = true; + # offload.offloadCmdMainProgram = "prime-run"; - nvidiaBusId = "PCI:1:0:0"; - intelBusId = "PCI:5:0:0"; - }; - hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; + nvidiaBusId = "PCI:1:0:0"; + intelBusId = "PCI:5:0:0"; + }; + hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; - services.xserver.videoDrivers = [ "nvidia" ]; + services.xserver.videoDrivers = [ "nvidia" ]; - environment.systemPackages = [ nvidia-offload ]; - }; - }; + environment.systemPackages = [ nvidia-offload ]; + }; + }; } diff --git a/modules/teh-nix/xorg.nix b/modules/teh-nix/xorg.nix index 17febd3..67b2c67 100644 --- a/modules/teh-nix/xorg.nix +++ b/modules/teh-nix/xorg.nix @@ -1,60 +1,64 @@ { inputs, ... }: { - flake.modules.nixos.teh-nix = - { config, lib, pkgs, ... }: - { - imports = [ - # inputs.YATwm.nixosModules.YATwm - ]; + flake.modules.nixos.teh-nix = + { + config, + lib, + pkgs, + ... + }: + { + imports = [ + # inputs.YATwm.nixosModules.YATwm + ]; - options.teh-nix.xorg = with lib; { - enable = mkEnableOption "Enable xorg"; - nvidia = mkOption { - type = types.bool; - default = true; - description = "Enable nvidia with xorg"; - }; - }; + options.teh-nix.xorg = with lib; { + enable = mkEnableOption "Enable xorg"; + nvidia = mkOption { + type = types.bool; + default = true; + description = "Enable nvidia with xorg"; + }; + }; - config = lib.mkIf config.teh-nix.xorg.enable { + config = lib.mkIf config.teh-nix.xorg.enable { - teh-nix.nvidia.enable = lib.mkIf config.teh-nix.xorg.nvidia (lib.mkDefault true); + teh-nix.nvidia.enable = lib.mkIf config.teh-nix.xorg.nvidia (lib.mkDefault true); - services.xserver = { - enable = true; + services.xserver = { + enable = true; - desktopManager = { - xterm.enable = false; - #default = "none"; - }; + desktopManager = { + xterm.enable = false; + #default = "none"; + }; - deviceSection = '' - Option "DRI" "2" - Option "TearFree" "true" - ''; + deviceSection = '' + Option "DRI" "2" + Option "TearFree" "true" + ''; - windowManager.i3 = { - enable = true; - package = pkgs.i3; - }; + windowManager.i3 = { + enable = true; + package = pkgs.i3; + }; - # windowManager.YATwm = { - # enable = true; - # package = inputs.YATwm.packages.x86_64-linux.YATwm; - # }; - }; - programs.i3lock.enable = true; + # windowManager.YATwm = { + # enable = true; + # package = inputs.YATwm.packages.x86_64-linux.YATwm; + # }; + }; + programs.i3lock.enable = true; - services.displayManager = { - #defaultSession = "none+i3"; - sddm.enable = true; - #sddm.theme = "catppuccin-macchiato"; - # ly.enable = true; - }; + services.displayManager = { + #defaultSession = "none+i3"; + sddm.enable = true; + #sddm.theme = "catppuccin-macchiato"; + # ly.enable = true; + }; - - services.xserver.xkb.layout = "us"; - services.xserver.xkb.options = "caps:super"; - }; - }; + services.xserver.xkb.layout = "us"; + services.xserver.xkb.options = "caps:super"; + }; + }; } diff --git a/modules/website/default.nix b/modules/website/default.nix index 8fc2477..ce288d0 100644 --- a/modules/website/default.nix +++ b/modules/website/default.nix @@ -1,20 +1,20 @@ { - perSystem = - { pkgs, ... }: - { - packages.teh-website = pkgs.callPackage ( - { stdenv, ... }: - stdenv.mkDerivation { - pname = "TehWebsite"; - version = "0.0.1"; + perSystem = + { pkgs, ... }: + { + packages.teh-website = pkgs.callPackage ( + { stdenv, ... }: + stdenv.mkDerivation { + pname = "TehWebsite"; + version = "0.0.1"; - src = ./src; + src = ./src; - installPhase = '' -mkdir -p $out/srv/www -cp -r ./* $out/srv/www -''; - } - ) { }; - }; + installPhase = '' + mkdir -p $out/srv/www + cp -r ./* $out/srv/www + ''; + } + ) { }; + }; } |
