diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 55067c4..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -secrets/* -!secrets/secrets.yaml diff --git a/.sops.yaml b/.sops.yaml deleted file mode 100644 index 915c7ae..0000000 --- a/.sops.yaml +++ /dev/null @@ -1,7 +0,0 @@ -keys: - - &terra age167thunwadsswd0u37tajk85wy4x7sgw6sg3j2aspcax7essmge6qwen0uz -creation_rules: - - path_regex: secrets/secrets.yaml$ - key_groups: - - age: - - *terra diff --git a/README.md b/README.md deleted file mode 100644 index 900ba14..0000000 --- a/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Setup when done cloning (i.e. things I need to put into my config) -* Logins: - * Bitwarden (Firefox & Desktop) - * Discord - * JetBrains - * Parsec - * Spotify - * Tailscale - * Whatsapp - -* Configure Display setup and refresh rate -* Rebuild: update .#hostname diff --git a/config/dotfiles/.warprc b/config/dotfiles/.warprc deleted file mode 100644 index 6e1cb33..0000000 --- a/config/dotfiles/.warprc +++ /dev/null @@ -1,5 +0,0 @@ -docs:~/Documents -down:~/Downloads -nix:~/nix-config -obs:~/Documents/Uni -prog:~/Programming diff --git a/config/lua/empty b/config/lua/empty deleted file mode 100644 index e69de29..0000000 diff --git a/flake.lock b/flake.lock index a527d34..46ac38f 100644 --- a/flake.lock +++ b/flake.lock @@ -7,31 +7,32 @@ ] }, "locked": { - "lastModified": 1739002622, - "narHash": "sha256-PtJV5OYQF7XO6XkDYypsYJS3+OsgYaYSmkO3I/A7lZo=", + "lastModified": 1736373539, + "narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=", "owner": "nix-community", "repo": "home-manager", - "rev": "947eef9e99c42346cf0aac2bebe1cd94924c173b", + "rev": "bd65bc3cde04c16755955630b344bc9e35272c56", "type": "github" }, "original": { "owner": "nix-community", + "ref": "release-24.11", "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1738961098, - "narHash": "sha256-yWNBf6VDW38tl179FEuJ0qukthVfB02kv+mRsfUsWC0=", + "lastModified": 1739055578, + "narHash": "sha256-2MhC2Bgd06uI1A0vkdNUyDYsMD0SLNGKtD8600mZ69A=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a3eaf5e8eca7cab680b964138fb79073704aca75", + "rev": "a45fa362d887f4d4a7157d95c28ca9ce2899b70e", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } @@ -74,11 +75,11 @@ ] }, "locked": { - "lastModified": 1738291974, - "narHash": "sha256-wkwYJc8cKmmQWUloyS9KwttBnja2ONRuJQDEsmef320=", + "lastModified": 1739262228, + "narHash": "sha256-7JAGezJ0Dn5qIyA2+T4Dt/xQgAbhCglh6lzCekTVMeU=", "owner": "Mic92", "repo": "sops-nix", - "rev": "4c1251904d8a08c86ac6bc0d72cc09975e89aef7", + "rev": "07af005bb7d60c7f118d9d9f5530485da5d1e975", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a9924df..274e294 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,9 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; home-manager = { - url = "github:nix-community/home-manager"; + url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -17,7 +17,6 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - }; outputs = { @@ -29,7 +28,6 @@ ... } @ inputs: let inherit (self) outputs; - # Supported systems for your flake packages, shell, etc. systems = [ "aarch64-linux" "i686-linux" @@ -37,28 +35,10 @@ "aarch64-darwin" "x86_64-darwin" ]; - # This is a function that generates an attribute by calling a function you - # pass to it, with each system as an argument forAllSystems = nixpkgs.lib.genAttrs systems; in { - # Your custom packages - # Accessible through 'nix build', 'nix shell', etc - packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); - # Formatter for your nix files, available through 'nix fmt' - # Other options beside 'alejandra' include 'nixpkgs-fmt' formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); - # Your custom packages and modifications, exported as overlays - overlays = import ./overlays {inherit inputs;}; - # Reusable nixos modules you might want to export - # These are usually stuff you would upstream into nixpkgs - nixosModules = import ./modules/nixos; - # Reusable home-manager modules you might want to export - # These are usually stuff you would upstream into home-manager - homeManagerModules = import ./modules/home-manager; - - # NixOS configuration entrypoint - # Available through 'nixos-rebuild --flake .#your-hostname' nixosConfigurations = { luna = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs outputs;}; @@ -67,7 +47,7 @@ home-manager.nixosModules.home-manager sops-nix.nixosModules.sops { - home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ]; + home-manager.sharedModules = [plasma-manager.homeManagerModules.plasma-manager]; } ]; }; @@ -78,7 +58,7 @@ home-manager.nixosModules.home-manager sops-nix.nixosModules.sops { - home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ]; + home-manager.sharedModules = [plasma-manager.homeManagerModules.plasma-manager]; } ]; }; diff --git a/home-manager/apps.nix b/home-manager/apps.nix deleted file mode 100644 index a7f7ca1..0000000 --- a/home-manager/apps.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - imports = [ - ./nvim/neovim.nix - ./plasma.nix - ]; - - nixpkgs = { - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - ]; - config = { - allowUnfree = true; - allowUnfreePredicate = _: true; - }; - }; - - home = { - username = "horseman"; - homeDirectory = "/home/horseman"; - }; - - programs.home-manager.enable = true; - programs.git = { - enable = true; - userName = "KoenDR06"; - userEmail = "koen.de.ruiter@hotmail.com"; - }; - - programs.gh.enable = true; - - systemd.user.startServices = "sd-switch"; - - home.stateVersion = "23.05"; -} diff --git a/home-manager/nvim/lualine.vim b/home-manager/nvim/lualine.vim deleted file mode 100644 index 8ef1150..0000000 --- a/home-manager/nvim/lualine.vim +++ /dev/null @@ -1,44 +0,0 @@ -lua << EOF - -require('lualine').setup { - options = { - icons_enabled = true, - theme = 'auto', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = false, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = {'filename'}, - lualine_x = {'encoding', 'fileformat', 'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} -} - -EOF diff --git a/home-manager/nvim/neovim.nix b/home-manager/nvim/neovim.nix deleted file mode 100644 index e878566..0000000 --- a/home-manager/nvim/neovim.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - programs.neovim = { - enable = true; - vimAlias = true; - - plugins = [ - { - plugin = pkgs.vimPlugins.vim-numbertoggle; - config = "set number norelativenumber"; - } - { plugin = pkgs.vimPlugins.vim-sleuth; } - { - plugin = pkgs.vimPlugins.lualine-nvim; - config = lib.fileContents ./lualine.vim; - # Change icons so that lualine looks nice in tty - } - { plugin = pkgs.vimPlugins.neoscroll-nvim; } - # Save lsat cursor position - # When in normal mode, I have to press arrow right to make a new line. Bad. - # Clock in vim - ]; - }; -} - - diff --git a/home-manager/server-apps.nix b/home-manager/server-apps.nix deleted file mode 100644 index d8c7420..0000000 --- a/home-manager/server-apps.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - imports = [ - ./nvim/neovim.nix - ]; - - nixpkgs = { - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - ]; - config = { - allowUnfree = true; - allowUnfreePredicate = _: true; - }; - }; - - home = { - username = "horseman"; - homeDirectory = "/home/horseman"; - }; - - home.packages = with pkgs; [ - direnv - docker-compose - fzf - gcc - gnupg - htop - jdk - nodejs_22 - python3 - sops - tailscale - tmux - unzip - wakeonlan - ]; - - programs.home-manager.enable = true; - programs.git = { - enable = true; - userName = "KoenDR06"; - userEmail = "koen.de.ruiter@hotmail.com"; - }; - - programs.gh.enable = true; - - systemd.user.startServices = "sd-switch"; - - home.stateVersion = "23.05"; -} diff --git a/machines/common/configuration.nix b/machines/common/configuration.nix deleted file mode 100644 index e3c3cb2..0000000 --- a/machines/common/configuration.nix +++ /dev/null @@ -1,146 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - imports = [ - ../../pkgs/zsh.nix - ]; - - nixpkgs = { - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - ]; - config = { - allowUnfree = true; - }; - }; - - nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); - - programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; [ - dotnetCorePackages.sdk_9_0 - ]; - - nix.nixPath = ["/etc/nix/path"]; - environment.etc = - lib.mapAttrs' - (name: value: { - name = "nix/path/${name}"; - value.source = value.flake; - }) - config.nix.registry; - - nix.settings.trusted-users = [ "root" "horseman" ]; - nix.settings = { - experimental-features = "nix-command flakes"; - auto-optimise-store = true; - }; - - time.timeZone = "Europe/Amsterdam"; - services.lorri.enable = true; - services.tailscale.enable = true; - - services.mullvad-vpn.enable = true; - services.mullvad-vpn.package = pkgs.mullvad-vpn; - networking.nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ]; - services.resolved = { - enable = true; - dnssec = "true"; - domains = [ "~." ]; - fallbackDns = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ]; - }; - - sops = { - defaultSopsFile = ../../secrets/secrets.yaml; - defaultSopsFormat = "yaml"; - age = { - sshKeyPaths = [ "/home/horseman/.ssh/id_ed25519" ]; - keyFile = "/home/horseman/.config/sops/age/keys.txt"; - generateKey = false; - }; - secrets = { - "syncthing/user".owner = "horseman"; - "syncthing/password".owner = "horseman"; - }; - templates = { - "syncuser".content = ''${config.sops.placeholder."syncthing/user"}''; - "syncpassword".content = ''${config.sops.placeholder."syncthing/password"}''; - }; - }; - - services.syncthing = { - enable = true; - user = "horseman"; - dataDir = "/home/horseman"; - configDir = "/home/horseman/.config/syncthing"; - overrideDevices = true; - overrideFolders = true; - settings = { - options = { - urAccepted = -1; - }; - gui = { - user = config.sops.templates."syncuser".content; - password = config.sops.templates."syncpassword".content; - }; - devices = { - "luna" = { - id = "MW4ZTAX-D7KDLRL-YHNGNCF-V6FW5L4-SCKQKES-BO7KV43-L5667GL-JHIYEAA"; - autoAcceptFolders = true; - name = "luna"; - }; - "terra" = { - id = "2QWRFLY-ZUY5C6C-X36R5CY-PJSGLYY-5HWIWJN-2YYWRPU-T66GJMU-GXTQ6QK"; - autoAcceptFolders = true; - name = "terra"; - }; - "solis" = { - id = "YOSYADZ-3OZ3XBH-7XEIK2W-DHAEIFD-5P5ZIHB-PAP74DH-T7GHLKT-O32YEA4"; - autoAcceptFolders = true; - name = "solis"; - }; - }; - folders = { - "Documents" = { - id = "documentFolder"; - path = "/home/horseman/Documents"; - devices = [ "luna" "terra" "solis" ]; - }; - }; - }; - }; - networking.firewall.allowedUDPPorts = [ 22000 21027 ]; - networking.firewall.allowedTCPPorts = [ 8384 22000 ]; - - users.users = { - horseman = { - initialPassword = "1234"; - isNormalUser = true; - openssh.authorizedKeys.keyFiles = [ - ../../config/ssh/authorized_keys - ]; - extraGroups = [ - "wheel" - "networkmanager" - "docker" - ]; - }; - }; - - services.openssh = { - enable = true; - settings = { - PermitRootLogin = "no"; - PasswordAuthentication = false; - }; - }; - - system.stateVersion = "23.11"; -} diff --git a/machines/luna/configuration.nix b/machines/luna/configuration.nix index cd2419d..6b95a6a 100644 --- a/machines/luna/configuration.nix +++ b/machines/luna/configuration.nix @@ -7,68 +7,11 @@ ... }: { imports = [ - inputs.home-manager.nixosModules.home-manager ./hardware-configuration.nix - ../../pkgs/firefox.nix - ../common/configuration.nix + ./modules.nix ]; - home-manager = { - extraSpecialArgs = { inherit inputs outputs; }; - users = { - horseman = import ../../home-manager/apps.nix; - }; - }; - networking.hostName = "luna"; - networking.networkmanager.enable = true; - networking.extraHosts = '' - 127.0.0.1 koala.rails.local members.rails.local leden.rails.local intro.rails.local - ''; - - services.xserver.enable = true; - services.desktopManager.plasma6.enable = true; - services.displayManager.sddm.enable = true; - services.displayManager.sddm.autoNumlock = true; - services.displayManager.defaultSession = "plasma"; - boot.loader.systemd-boot.enable = true; - boot.kernelModules = [ "snd-seq" "snd-rawmidi" ]; - - hardware.bluetooth.enable = true; - hardware.pulseaudio.enable = false; - services.jack = { - jackd.enable = false; - alsa.enable = true; - loopback.enable = false; - }; - - environment.plasma6.excludePackages = with pkgs.kdePackages; [ - kate - konsole - ]; - environment.gnome.excludePackages = with pkgs; [ - gnome-calendar - gnome-characters - nautilus - gnome-clocks - gnome-contacts - evince - file-roller - geary - gnome-system-monitor - eog - gnome-logs - gnome-maps - gnome-music - seahorse - gnome-text-editor - ]; - - - virtualisation.docker.enable = true; - - virtualisation.virtualbox.host.enable = true; - users.extraGroups.vboxusers.members = [ "horseman" ]; - - users.extraUsers.horseman.extraGroups = [ "jackaudio" ]; + + system.stateVersion = "24.11"; } diff --git a/machines/luna/hardware-configuration.nix b/machines/luna/hardware-configuration.nix index d3d28bb..71b72e4 100644 --- a/machines/luna/hardware-configuration.nix +++ b/machines/luna/hardware-configuration.nix @@ -1,29 +1,33 @@ # 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") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/c1447573-eee5-48ea-9937-84330065628b"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/c1447573-eee5-48ea-9937-84330065628b"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/B516-99F1"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/B516-99F1"; + fsType = "vfat"; + }; - swapDevices = [ ]; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/machines/luna/modules.nix b/machines/luna/modules.nix new file mode 100644 index 0000000..18ec7ce --- /dev/null +++ b/machines/luna/modules.nix @@ -0,0 +1,44 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + imports = [../../modules]; + + config.horseman = { + users.horseman.enable = true; + + base = { + nix.enable = true; + }; + + boot = { + loader.systemd.enable = true; + greeter.sddm.enable = true; + }; + + wm = { + plasma.enable = true; + }; + + hardware = { + audio.enable = true; + bluetooth.enable = true; + wifi.enable = true; + }; + + network = { + mullvad.enable = true; + ssh.enable = true; + syncthing.enable = true; + tailscale.enable = true; + }; + + apps = { + dev.enable = true; + }; + }; +} diff --git a/machines/solis/configuration.nix b/machines/solis/configuration.nix index ed28772..c57ed6d 100644 --- a/machines/solis/configuration.nix +++ b/machines/solis/configuration.nix @@ -6,57 +6,7 @@ pkgs, ... }: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ./hardware-configuration.nix - ../common/configuration.nix - ../../modules/sleep-at-night.nix - ]; - - home-manager = { - extraSpecialArgs = { inherit inputs outputs; }; - users = { - horseman = import ../../home-manager/server-apps.nix; - }; - }; + imports = []; networking.hostName = "solis"; - - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/sda"; - - virtualisation.docker.enable = true; - - services.resolved.enable = true; - services.resolved.extraConfig = "DNSStubListener=no\n"; - - systemd.timers."backupSyncthing" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "weekly"; - Persistent = true; - }; - }; - - systemd.services."backupSyncthing" = { - script = '' - /home/horseman/nix-config/misc/backup.sh - ''; - serviceConfig = { - Type = "oneshot"; - User = "horseman"; - }; - }; - - # services.sleep-at-night = { - # enable = true; - # shutdown = { - # hour = 00; - # minute = 30; - # }; - # wakeup = "08:00:00"; - # }; - - networking.firewall.enable = true; - networking.firewall.allowPing = true; } diff --git a/machines/solis/hardware-configuration.nix b/machines/solis/hardware-configuration.nix index 02593b1..ebb14ae 100644 --- a/machines/solis/hardware-configuration.nix +++ b/machines/solis/hardware-configuration.nix @@ -1,26 +1,30 @@ # 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") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "ahci" "ohci_pci" "ehci_pci" "pata_atiixp" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["ahci" "ohci_pci" "ehci_pci" "pata_atiixp" "usb_storage" "usbhid" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/74211087-d087-49d5-bc58-eb49748a51f0"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/74211087-d087-49d5-bc58-eb49748a51f0"; + fsType = "ext4"; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/bfe8c490-e8d7-438e-b95b-5bc5743bb23b"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/bfe8c490-e8d7-438e-b95b-5bc5743bb23b";} + ]; # 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 diff --git a/machines/terra/configuration.nix b/machines/terra/configuration.nix index 0e90857..4b20042 100644 --- a/machines/terra/configuration.nix +++ b/machines/terra/configuration.nix @@ -6,104 +6,7 @@ pkgs, ... }: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ./hardware-configuration.nix - ./refind.nix - ../../pkgs/firefox.nix - ../common/configuration.nix - ]; - - # NVIDIA Drivers - hardware.graphics.enable32Bit = true; - hardware.graphics.enable = true; - services.xserver.videoDrivers = ["nvidia"]; - hardware.nvidia = { - modesetting.enable = true; - powerManagement.enable = false; - powerManagement.finegrained = false; - open = true; - nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.stable; - }; - # End NVIDIA - - - home-manager = { - extraSpecialArgs = { inherit inputs outputs; }; - users = { - horseman = import ../../home-manager/apps.nix; - }; - }; + imports = []; networking.hostName = "terra"; - - systemd.timers."enable-wol" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnBootSec = "5m"; - OnUnitActiveSec = "1m"; - Unit = "enable-wol.service"; - }; - }; - - systemd.services."enable-wol" = { - script = '' - /home/horseman/nix-config/misc/startup.sh - ''; - serviceConfig = { - Type = "oneshot"; - User = "root"; - }; - }; - - environment.systemPackages = with pkgs; [ - ethtool - ]; - - environment.plasma6.excludePackages = with pkgs.kdePackages; [ - kate - konsole - ]; - environment.gnome.excludePackages = with pkgs; [ - gnome-calendar - gnome-characters - nautilus - gnome-clocks - gnome-contacts - evince - file-roller - geary - gnome-system-monitor - eog - gnome-logs - gnome-maps - gnome-music - seahorse - gnome-text-editor - ]; - - services.xserver.enable = true; - services.desktopManager.plasma6.enable = true; - services.xserver.desktopManager.gnome.enable = true; - services.displayManager.sddm.enable = true; - services.displayManager.sddm.autoNumlock = true; - services.displayManager.sddm.wayland.enable = false; - services.displayManager.defaultSession = "plasma"; - boot.loader.systemd-boot.enable = true; - - programs.ssh.askPassword = lib.mkForce "/nix/store/qrzq7dqp8dkffb5dvi42q647dhm87ady-ksshaskpass-6.0.3/bin/ksshaskpass"; - - networking.networkmanager.enable = true; - - virtualisation.docker.enable = true; - - hardware.pulseaudio.enable = false; - services.jack = { - jackd.enable = true; - alsa.enable = false; - loopback.enable = true; - }; - - users.extraUsers.horseman.extraGroups = [ "jackaudio" ]; } diff --git a/machines/terra/hardware-configuration.nix b/machines/terra/hardware-configuration.nix index 509f196..f06e944 100644 --- a/machines/terra/hardware-configuration.nix +++ b/machines/terra/hardware-configuration.nix @@ -1,31 +1,35 @@ # 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") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/4d963cda-4ec7-4cee-8e82-35402d385f54"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/4d963cda-4ec7-4cee-8e82-35402d385f54"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6AB6-63FD"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/6AB6-63FD"; + fsType = "vfat"; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/53db744d-a858-49b0-a3a1-c7c576aba0c9"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/53db744d-a858-49b0-a3a1-c7c576aba0c9";} + ]; # 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 diff --git a/machines/terra/refind.nix b/machines/terra/refind.nix deleted file mode 100644 index cdefb1d..0000000 --- a/machines/terra/refind.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - environment.systemPackages = [ - pkgs.refind - pkgs.efibootmgr - ]; -} diff --git a/misc/backup.sh b/misc/backup.sh deleted file mode 100755 index f8eab6c..0000000 --- a/misc/backup.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/run/current-system/sw/bin/zsh - -cd /home/horseman -file=backups/$(date +%Y-%m-%d).tar -tar -cf $file Documents - -if grep -q $(sha256sum $file) backups/sum; then - echo 'hashes match, quitting' - rm $file - exit 0 -fi -echo $(sha256sum $file) > backups/sum - -exit 0 diff --git a/misc/nixos_wallpaper_dark_3840x2160.png b/misc/nixos_wallpaper_dark_3840x2160.png deleted file mode 100644 index 879b65a..0000000 Binary files a/misc/nixos_wallpaper_dark_3840x2160.png and /dev/null differ diff --git a/misc/nixos_wallpaper_light_3840x2160.png b/misc/nixos_wallpaper_light_3840x2160.png deleted file mode 100644 index 3fff85b..0000000 Binary files a/misc/nixos_wallpaper_light_3840x2160.png and /dev/null differ diff --git a/misc/startup.sh b/misc/startup.sh deleted file mode 100755 index 3c0122f..0000000 --- a/misc/startup.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/run/current-system/sw/bin/zsh - -sudo ethtool -s eno1 wol g diff --git a/misc/switch-to-dark-theme.sh b/misc/switch-to-dark-theme.sh deleted file mode 100755 index 102d70e..0000000 --- a/misc/switch-to-dark-theme.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -lookandfeeltool -a org.kde.breezedark.desktop - -qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript ' -var allDesktops = desktops(); -for (i = 0; i < allDesktops.length; i++) { - d = allDesktops[i]; - d.wallpaperPlugin = "org.kde.image"; - d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General"); - d.writeConfig("Image", "file:///home/horseman/nix-config/misc/nixos_wallpaper_dark_3840x2160.png"); -}' diff --git a/misc/switch-to-light-theme.sh b/misc/switch-to-light-theme.sh deleted file mode 100755 index d34fed6..0000000 --- a/misc/switch-to-light-theme.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -lookandfeeltool -a org.kde.breeze.desktop - -qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript ' -var allDesktops = desktops(); -for (i = 0; i < allDesktops.length; i++) { - d = allDesktops[i]; - d.wallpaperPlugin = "org.kde.image"; - d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General"); - d.writeConfig("Image", "file:///home/horseman/nix-config/misc/nixos_wallpaper_light_3840x2160.png"); -}' diff --git a/modules/apps/default.nix b/modules/apps/default.nix new file mode 100644 index 0000000..66839cb --- /dev/null +++ b/modules/apps/default.nix @@ -0,0 +1,7 @@ +{inputs, ...}: { + imports = [ + ./terminal.nix + ./visual.nix + ./dev.nix + ]; +} diff --git a/modules/apps/dev.nix b/modules/apps/dev.nix new file mode 100644 index 0000000..c76b0e4 --- /dev/null +++ b/modules/apps/dev.nix @@ -0,0 +1,22 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.apps.dev; +in { + options = { + horseman.apps.dev = { + enable = mkEnableOption "Apps used for programming"; + }; + }; + + config = { + # Docker + virtualisation.docker.enable = true; + }; +} diff --git a/modules/apps/terminal.nix b/modules/apps/terminal.nix new file mode 100644 index 0000000..763902e --- /dev/null +++ b/modules/apps/terminal.nix @@ -0,0 +1,24 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.apps.terminal; +in { + options = { + horseman.apps.terminal = { + enable = mkEnableOption "Apps that run only in terminal without a GUI"; + }; + }; + + config = { + services.lorri.enable = true; + + environment.systemPackages = with pkgs; [ + ]; + }; +} diff --git a/overhaul/modules/boot/refind.nix b/modules/apps/visual.nix similarity index 54% rename from overhaul/modules/boot/refind.nix rename to modules/apps/visual.nix index d9ae47d..bf630c7 100644 --- a/overhaul/modules/boot/refind.nix +++ b/modules/apps/visual.nix @@ -7,17 +7,16 @@ ... }: let inherit (lib) mkEnableOption mkIf mkOption types; - cfg = config.horseman.boot.refind; + cfg = config.horseman.apps.visual; in { options = { - horseman.boot.refind = { - enable = mkEnableOption "Enables rEFInd, the bootloader"; + horseman.apps.visual = { + enable = mkEnableOption "Apps that run in a visual window"; }; }; - config = mkIf cfg.enable { + config = { environment.systemPackages = with pkgs; [ - refind ]; }; } diff --git a/modules/apps/visual/firefox.nix b/modules/apps/visual/firefox.nix new file mode 100644 index 0000000..2b0730d --- /dev/null +++ b/modules/apps/visual/firefox.nix @@ -0,0 +1,66 @@ +{ + config, + pkgs, + ... +}: { + programs.firefox = { + enable = true; + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + DisplayBookmarksToolbar = "never"; + PasswordManagerEnabled = false; + + ExtensionSettings = { + "*".installation_mode = "blocked"; + # uBlock Origin: + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + # Dark Reader + "addon@darkreader.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi"; + installation_mode = "force_installed"; + }; + # Advent of Code delta-rank + "{78b07db2-25ed-4088-9c92-5c5dcfca3c3c}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/advent-of-code-delta-score/latest.xpi"; + installation_mode = "force_installed"; + }; + # SponsorBlock + "sponsorBlocker@ajay.app" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi"; + installation_mode = "force_installed"; + }; + # KeepassXC + "keepassxc-browser@keepassxc.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/keepassxc-browser/latest.xpi"; + installation_mode = "force_installed"; + }; + # Cookie Blocker + "idcac-pub@guus.ninja" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/istilldontcareaboutcookies/latest.xpi"; + installation_mode = "force_installed"; + }; + # Ghostery + "firefox@ghostery.com" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ghostery/latest.xpi"; + installation_mode = "force_installed"; + }; + }; + + Preferences = { + general = { + autoScroll = true; + }; + "browser.newtabpage.activity-stream.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; + }; + }; + }; +} diff --git a/modules/base/default.nix b/modules/base/default.nix new file mode 100644 index 0000000..fd36964 --- /dev/null +++ b/modules/base/default.nix @@ -0,0 +1,5 @@ +{inputs, ...}: { + imports = [ + ./nix.nix + ]; +} diff --git a/overhaul/modules/common/locale.nix b/modules/base/locale.nix similarity index 55% rename from overhaul/modules/common/locale.nix rename to modules/base/locale.nix index 06c1336..50d21c6 100644 --- a/overhaul/modules/common/locale.nix +++ b/modules/base/locale.nix @@ -7,15 +7,15 @@ ... }: let inherit (lib) mkEnableOption mkIf mkOption types; - cfg = config.horseman.common.locale; + cfg = config.horseman.base.locale; in { options = { - horseman.common.locale = { - enable = mkEnableOption "Dutch locale settings"; + horseman.base.locale = { + enable = mkEnableOption "Locale settings"; }; }; - config = mkIf cfg.enable { + config = { time.timeZone = "Europe/Amsterdam"; }; } diff --git a/overhaul/modules/common/nix.nix b/modules/base/nix.nix similarity index 61% rename from overhaul/modules/common/nix.nix rename to modules/base/nix.nix index 1815ef4..bade9ac 100644 --- a/overhaul/modules/common/nix.nix +++ b/modules/base/nix.nix @@ -7,16 +7,21 @@ ... }: let inherit (lib) mkEnableOption mkIf mkOption types; - cfg = config.horseman.common.nix; + cfg = config.horseman.base.nix; in { options = { - horseman.common.nix = { - enable = mkEnableOption "Nix settings"; + horseman.base.nix = { + enable = mkEnableOption "Standard settings for nix"; }; }; - config = mkIf cfg.enable { + config = { nixpkgs = { + overlays = [ + # outputs.overlays.additions + # outputs.overlays.modifications + # outputs.overlays.unstable-packages + ]; config = { allowUnfree = true; }; @@ -25,7 +30,9 @@ in { nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; []; + programs.nix-ld.libraries = with pkgs; [ + dotnetCorePackages.sdk_9_0 + ]; nix.nixPath = ["/etc/nix/path"]; environment.etc = @@ -36,7 +43,7 @@ in { }) config.nix.registry; - nix.settings.trusted-users = [ "root" "horseman" ]; + nix.settings.trusted-users = ["root" "horseman"]; nix.settings = { experimental-features = "nix-command flakes"; auto-optimise-store = true; diff --git a/modules/boot/default.nix b/modules/boot/default.nix new file mode 100644 index 0000000..01712e3 --- /dev/null +++ b/modules/boot/default.nix @@ -0,0 +1,6 @@ +{inputs, ...}: { + imports = [ + ./loader/systemd.nix + ./greeter/sddm.nix + ]; +} diff --git a/modules/boot/greeter/sddm.nix b/modules/boot/greeter/sddm.nix new file mode 100644 index 0000000..4a2993c --- /dev/null +++ b/modules/boot/greeter/sddm.nix @@ -0,0 +1,21 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.boot.greeter.sddm; +in { + options = { + horseman.boot.greeter.sddm = { + enable = mkEnableOption "SDDM Greeter"; + }; + }; + + config = { + services.displayManager.sddm.enable = true; + }; +} diff --git a/modules/boot/loader/systemd.nix b/modules/boot/loader/systemd.nix new file mode 100644 index 0000000..d873ac2 --- /dev/null +++ b/modules/boot/loader/systemd.nix @@ -0,0 +1,22 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.boot.loader.systemd; +in { + options = { + horseman.boot.loader.systemd = { + enable = mkEnableOption "Sets systemd as the bootloader"; + }; + }; + + config = { + boot.loader.systemd-boot.enable = true; + boot.loader.systemd-boot.configurationLimit = 10; + }; +} diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..15c8b01 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,12 @@ +{inputs, ...}: { + imports = [ + ./apps + ./hardware + ./network + ./terminal + ./wm + ./users + ./boot + ./base + ]; +} diff --git a/modules/hardware/audio.nix b/modules/hardware/audio.nix new file mode 100644 index 0000000..13ccc17 --- /dev/null +++ b/modules/hardware/audio.nix @@ -0,0 +1,27 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.hardware.audio; +in { + options = { + horseman.hardware.audio = { + enable = mkEnableOption ""; + }; + }; + + config = { + hardware.pulseaudio.enable = false; + services.jack = { + jackd.enable = false; + alsa.enable = true; + loopback.enable = false; + }; + users.extraUsers.horseman.extraGroups = ["jackaudio"]; + }; +} diff --git a/modules/hardware/bluetooth.nix b/modules/hardware/bluetooth.nix new file mode 100644 index 0000000..adfa8f1 --- /dev/null +++ b/modules/hardware/bluetooth.nix @@ -0,0 +1,21 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.hardware.bluetooth; +in { + options = { + horseman.hardware.bluetooth = { + enable = mkEnableOption "Bluetooth"; + }; + }; + + config = { + hardware.bluetooth.enable = true; + }; +} diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix new file mode 100644 index 0000000..3110830 --- /dev/null +++ b/modules/hardware/default.nix @@ -0,0 +1,8 @@ +{inputs, ...}: { + imports = [ + ./audio.nix + ./bluetooth.nix + ./gpu/nvidia.nix + ./wifi.nix + ]; +} diff --git a/modules/hardware/gpu/nvidia.nix b/modules/hardware/gpu/nvidia.nix new file mode 100644 index 0000000..343297c --- /dev/null +++ b/modules/hardware/gpu/nvidia.nix @@ -0,0 +1,31 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.hardware.gpu.nvidia; +in { + options = { + horseman.hardware.gpu.nvidia = { + enable = mkEnableOption "Enable support for NVIDIA GPUs"; + }; + }; + + config = { + hardware.graphics.enable32Bit = true; + hardware.graphics.enable = true; + services.xserver.videoDrivers = ["nvidia"]; + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + }; +} diff --git a/modules/hardware/wifi.nix b/modules/hardware/wifi.nix new file mode 100644 index 0000000..00cf995 --- /dev/null +++ b/modules/hardware/wifi.nix @@ -0,0 +1,22 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.hardware.wifi; +in { + options = { + horseman.hardware.wifi = { + enable = mkEnableOption ""; + }; + }; + + config = { + networking.networkmanager.enable = true; + users.users.horseman.extraGroups = ["networkmanager"]; + }; +} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix deleted file mode 100644 index 45aae31..0000000 --- a/modules/home-manager/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module). -# These should be stuff you would like to share with others, not your personal configurations. -{ - # List your module files here - # my-module = import ./my-module.nix; -} diff --git a/modules/network/default.nix b/modules/network/default.nix new file mode 100644 index 0000000..2d78aa3 --- /dev/null +++ b/modules/network/default.nix @@ -0,0 +1,8 @@ +{inputs, ...}: { + imports = [ + ./mullvad.nix + ./ssh.nix + ./syncthing.nix + ./tailscale.nix + ]; +} diff --git a/modules/network/mullvad.nix b/modules/network/mullvad.nix new file mode 100644 index 0000000..8fb6041 --- /dev/null +++ b/modules/network/mullvad.nix @@ -0,0 +1,33 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.network.mullvad; +in { + options = { + horseman.network.mullvad = { + enable = mkEnableOption "Enables the Mullvad VPN"; + }; + }; + + config = { + services = { + mullvad-vpn = { + enable = true; + package = pkgs.mullvad-vpn; + }; + resolved = { + enable = true; + dnssec = "true"; + domains = ["~."]; + fallbackDns = ["1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one"]; + }; + }; + networking.nameservers = ["1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one"]; + }; +} diff --git a/modules/network/ssh.nix b/modules/network/ssh.nix new file mode 100644 index 0000000..26871d3 --- /dev/null +++ b/modules/network/ssh.nix @@ -0,0 +1,41 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.network.ssh; +in { + options = { + horseman.network.ssh = { + enable = mkEnableOption ""; + }; + }; + + config = { + services.openssh = { + banner = '' + ================================================================== + === ==== ==== ========= ================================= === + === ==== ==== ========= ================================= === + === ==== ==== ========= ================================= === + === ==== ==== === === === ==== === = = ==== === === + === == == === = == == = == == == = == === + ==== == == === == == ===== = == = = == == === + ==== == == === ===== == ===== = == = = == ========== + ===== == ==== = == == = == = == = = == = == === + ====== ==== ====== === === ==== === = = === === === + ================================================================== + ''; + + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; + }; +} diff --git a/modules/network/syncthing.nix b/modules/network/syncthing.nix new file mode 100644 index 0000000..6aa2df5 --- /dev/null +++ b/modules/network/syncthing.nix @@ -0,0 +1,59 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.network.syncthing; +in { + options = { + horseman.network.syncthing = { + enable = mkEnableOption ""; + }; + }; + + config = { + services.syncthing = { + enable = true; + user = "horseman"; + dataDir = "/home/horseman"; + configDir = "/home/horseman/.config/syncthing"; + overrideDevices = true; + overrideFolders = true; + settings = { + options = { + urAccepted = -1; + }; + devices = { + "luna" = { + id = "MW4ZTAX-D7KDLRL-YHNGNCF-V6FW5L4-SCKQKES-BO7KV43-L5667GL-JHIYEAA"; + autoAcceptFolders = true; + name = "luna"; + }; + "terra" = { + id = "2QWRFLY-ZUY5C6C-X36R5CY-PJSGLYY-5HWIWJN-2YYWRPU-T66GJMU-GXTQ6QK"; + autoAcceptFolders = true; + name = "terra"; + }; + "solis" = { + id = "YOSYADZ-3OZ3XBH-7XEIK2W-DHAEIFD-5P5ZIHB-PAP74DH-T7GHLKT-O32YEA4"; + autoAcceptFolders = true; + name = "solis"; + }; + }; + folders = { + "Documents" = { + id = "documentFolder"; + path = "/home/horseman/Documents"; + devices = ["luna" "terra" "solis"]; + }; + }; + }; + }; + networking.firewall.allowedUDPPorts = [22000 21027]; + networking.firewall.allowedTCPPorts = [8384 22000]; + }; +} diff --git a/modules/network/tailscale.nix b/modules/network/tailscale.nix new file mode 100644 index 0000000..e917177 --- /dev/null +++ b/modules/network/tailscale.nix @@ -0,0 +1,21 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.network.tailscale; +in { + options = { + horseman.network.tailscale = { + enable = mkEnableOption "Enable the Tailscale VPN service"; + }; + }; + + config = { + services.tailscale.enable = true; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix deleted file mode 100644 index 8605069..0000000 --- a/modules/nixos/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module). -# These should be stuff you would like to share with others, not your personal configurations. -{ - # List your module files here - # my-module = import ./my-module.nix; -} diff --git a/modules/sleep-at-night.nix b/modules/sleep-at-night.nix deleted file mode 100644 index ccad600..0000000 --- a/modules/sleep-at-night.nix +++ /dev/null @@ -1,79 +0,0 @@ -{config, pkgs, lib, ...}: - -let - cfg = config.services.sleep-at-night; - sleep-if-night = pkgs.writeScriptBin "sleep-if-night" '' - #!${pkgs.bash}/bin/bash - wakeupTime="$3" - shutdownHour="00$1" - shutdownHour="''${shutdownHour:(-2)}" - shutdownMinute="00$2" - shutdownMinute="''${shutdownMinute:(-2)}" - currentHour="$(${pkgs.coreutils}/bin/date +%H)" - currentMinute="$(${pkgs.coreutils}/bin/date +%M)" - if [[ "$currentHour" -eq "$shutdownHour" ]] && [[ "$currentMinute" -eq "$shutdownMinute" ]] - then - echo "Shutting down now. Waking up at $wakeupTime". - ${pkgs.utillinux}/bin/rtcwake -m off -t "$(${pkgs.coreutils}/bin/date -d "$wakeupTime" +%s)"; - else - echo "Current time is $currentHour:$currentMinute. Shutting down at $shutdownHour:$shutdownMinute." - exit 0 - fi - ''; -in - with lib; { - - options = { - services.sleep-at-night = { - - enable = mkOption { - default = false; - type = with types; bool; - description = '' - Sleep at night. - If you start the system after the given `shutdown` time, the system will keep running until the `shutdown` time occurs again, even if you start it before the given `wakeup` time. - ''; - }; - - wakeup = mkOption { - default = "09:00:00"; - type = with types; str; - description = '' - Wake up at given time. - The time has to be parsable by `date -d`. - ''; - }; - - shutdown = { - hour = mkOption { - default = 01; - type = with types; ints.between 0 23; - description = '' - Shut down at given hour. - ''; - }; - minute = mkOption { - default = 00; - type = with types; ints.between 0 59; - description = '' - Shut down at given minute of the given `hour`. - ''; - }; - }; - }; - }; - - config = mkIf cfg.enable { - systemd.services.sleep-at-night = { - description = "Sleep at night."; - serviceConfig = { - ExecStart = "${sleep-if-night}/bin/sleep-if-night ${toString cfg.shutdown.hour} ${toString cfg.shutdown.minute} ${cfg.wakeup}"; - Restart = "on-success"; - RestartSec = 30; - User = "root"; - }; - wantedBy = [ "multi-user.target" ]; - }; - }; - - } diff --git a/overhaul/modules/template.nix b/modules/template.nix similarity index 64% rename from overhaul/modules/template.nix rename to modules/template.nix index 4f7f022..dabd470 100644 --- a/overhaul/modules/template.nix +++ b/modules/template.nix @@ -7,15 +7,14 @@ ... }: let inherit (lib) mkEnableOption mkIf mkOption types; - cfg = config.horseman.xxxxxx.xxxxxx; + cfg = config.horseman.xxx.yyy; in { options = { - horseman.xxxxxx.xxxxxx = { + horseman.xxx.yyy = { enable = mkEnableOption ""; }; }; - config = mkIf cfg.enable { - + config = { }; } diff --git a/modules/terminal/default.nix b/modules/terminal/default.nix new file mode 100644 index 0000000..a2d32af --- /dev/null +++ b/modules/terminal/default.nix @@ -0,0 +1,5 @@ +{inputs, ...}: { + imports = [ + ./zsh.nix + ]; +} diff --git a/overhaul/modules/terminal/zsh.nix b/modules/terminal/zsh.nix similarity index 70% rename from overhaul/modules/terminal/zsh.nix rename to modules/terminal/zsh.nix index 1075c15..9080812 100644 --- a/overhaul/modules/terminal/zsh.nix +++ b/modules/terminal/zsh.nix @@ -7,19 +7,17 @@ ... }: let inherit (lib) mkEnableOption mkIf mkOption types; - cfg = config.horseman.base.locale; + cfg = config.horseman.terminal.zsh; in { options = { horseman.terminal.zsh = { - enable = mkEnableOption "Enable ZSH and all associated plugins"; + enable = mkEnableOption "The ZSH shell and plugins for it"; }; }; - config = mkIf cfg.enable { - services.lorri.enable = true; - + config = { users.defaultUserShell = pkgs.zsh; - environment.shells = with pkgs; [ zsh ]; + environment.shells = with pkgs; [zsh]; programs.zsh = { enable = true; @@ -28,8 +26,8 @@ in { histSize = 10000; shellAliases = { - clone-dotfiles = "cp /home/horseman/nix-config/config/dotfiles/.\* /home/horseman/"; - rebuild = "nix fmt && clone-dotfiles && sudo nixos-rebuild switch --flake"; + clone-dotfiles = "cp -r /home/horseman/nix-config/config/dotfiles/.\* /home/horseman/"; + rebuild = "clone-dotfiles && sudo nixos-rebuild switch --flake"; update = "sudo nix flake update && rebuild"; compose = "sudo docker compose"; wolpc = "wakeonlan D8:5E:D3:A8:B1:0A"; diff --git a/modules/users/default.nix b/modules/users/default.nix new file mode 100644 index 0000000..0adcd76 --- /dev/null +++ b/modules/users/default.nix @@ -0,0 +1,5 @@ +{inputs, ...}: { + imports = [ + ./horseman.nix + ]; +} diff --git a/modules/users/horseman.nix b/modules/users/horseman.nix new file mode 100644 index 0000000..13bb1c4 --- /dev/null +++ b/modules/users/horseman.nix @@ -0,0 +1,38 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.users.horseman; +in { + options = { + horseman.users.horseman = { + enable = mkEnableOption "Default user"; + }; + }; + + config = { + home-manager = { + extraSpecialArgs = {inherit inputs outputs;}; + users.horseman = { + home.stateVersion = "24.11"; + }; + }; + + users.users.horseman = { + initialPassword = "1234"; + isNormalUser = true; + openssh.authorizedKeys.keyFiles = [ + ../../config/ssh/authorized_keys + ]; + extraGroups = [ + "wheel" + "docker" + ]; + }; + }; +} diff --git a/modules/wm/default.nix b/modules/wm/default.nix new file mode 100644 index 0000000..4db5899 --- /dev/null +++ b/modules/wm/default.nix @@ -0,0 +1,7 @@ +{inputs, ...}: { + imports = [ + ./gnome + ./plasma + ./qtile + ]; +} diff --git a/home-manager/gnome.nix b/modules/wm/gnome/config.nix similarity index 97% rename from home-manager/gnome.nix rename to modules/wm/gnome/config.nix index 85e9a32..11076e8 100644 --- a/home-manager/gnome.nix +++ b/modules/wm/gnome/config.nix @@ -1,7 +1,4 @@ -{ - pkgs, - ... -}: { +{pkgs, ...}: { dconf.settings = { "org/gnome/desktop/peripherals/touchpad" = { natural-scroll = false; @@ -12,7 +9,7 @@ enable-hot-corners = false; show-battery-percentage = true; }; - + "org/gnome/desktop/search-providers" = { disabled = [ "org.gnome.seahorse.Application.desktop" @@ -29,17 +26,17 @@ "org.gnome.Characters.desktop" "org.gnome.Contacts.desktop" "org.gnome.Nautilus.desktop" - "org.gnome.Calendar.desktop" + "org.gnome.Calendar.desktop" "org.gnome.clocks.desktop" "org.gnome.seahorse.Application.desktop" "org.gnome.Photos.desktop" ]; }; - + "org/gnome/desktop/wm/preferences" = { num-workspaces = 3; }; - + "org/gnome/shell" = { favorite-apps = [ "firefox.desktop" @@ -56,7 +53,7 @@ ]; disable-user-extensions = false; }; - + "org/gnome/shell/extensions/just-perfection" = { activities-button = false; app-menu = false; @@ -77,12 +74,12 @@ "parsecd.desktop:3" ]; }; - + "org/gnome/settings-daemon/plugins/power" = { power-button-action = "nothing"; sleep-inactive-ac-type = "nothing"; }; - + "org/gnome/mutter" = { edge-tiling = true; dynamic-workspaces = false; @@ -106,7 +103,7 @@ command = "kgx"; name = "Console"; }; - + "org/gnome/desktop/wm/keybindings" = { switch-applications = ["Z"]; switch-applications-backward = ["Z"]; @@ -119,7 +116,7 @@ switch-to-workspace-left = ["Left"]; switch-to-workspace-right = ["Right"]; }; - + "org/gnome/settings-daemon/plugins/media-keys" = { screensaver = ["l"]; home = ["e"]; @@ -127,15 +124,15 @@ "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" ]; }; - + "org/gnome/shell/keybindings" = { screenshot = ["Print"]; show-screenshot-ui = ["s"]; toggle-message-tray = ["v"]; }; - + "org/gnome/mutter/wayland/keybindings" = { restore-shortcuts = "disabled"; }; }; -} \ No newline at end of file +} diff --git a/modules/wm/gnome/default.nix b/modules/wm/gnome/default.nix new file mode 100644 index 0000000..d5c3db2 --- /dev/null +++ b/modules/wm/gnome/default.nix @@ -0,0 +1,46 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.wm.gnome; +in { + options = { + horseman.desktop.gnome = { + enable = mkEnableOption "Gnome"; + }; + }; + + config = { + services.xserver = { + enable = true; + desktopManager.gnome.enable = true; + }; + + environment.gnome.excludePackages = with pkgs; [ + gnome-calendar + gnome-characters + nautilus + gnome-clocks + gnome-contacts + evince + file-roller + geary + gnome-system-monitor + eog + gnome-logs + gnome-maps + gnome-music + seahorse + gnome-text-editor + ]; + + home-manager.users.horseman = { + imports = [./config.nix]; + }; + }; +} diff --git a/home-manager/plasma.nix b/modules/wm/plasma/config.nix similarity index 85% rename from home-manager/plasma.nix rename to modules/wm/plasma/config.nix index dc8113e..74ab722 100644 --- a/home-manager/plasma.nix +++ b/modules/wm/plasma/config.nix @@ -2,10 +2,10 @@ programs.plasma = { enable = true; shortcuts = { - "ActivityManager"."switch-to-activity-b2ab5fe5-5164-403b-a54c-47948116f11a" = [ ]; - "ActivityManager"."switch-to-activity-c82192f5-3d2d-4f8d-9c58-364b4cca1b53" = [ ]; - "ActivityManager"."switch-to-activity-d15629d7-eac1-4856-990c-e88d4acd7c5d" = [ ]; - "ActivityManager"."switch-to-activity-df5108d4-687b-4cd3-835e-318d72116b93" = [ ]; + "ActivityManager"."switch-to-activity-b2ab5fe5-5164-403b-a54c-47948116f11a" = []; + "ActivityManager"."switch-to-activity-c82192f5-3d2d-4f8d-9c58-364b4cca1b53" = []; + "ActivityManager"."switch-to-activity-d15629d7-eac1-4856-990c-e88d4acd7c5d" = []; + "ActivityManager"."switch-to-activity-df5108d4-687b-4cd3-835e-318d72116b93" = []; "KDE Keyboard Layout Switcher"."Switch to Last-Used Keyboard Layout" = "Meta+Alt+L"; "KDE Keyboard Layout Switcher"."Switch to Next Keyboard Layout" = "Meta+Alt+K"; "kaccess"."Toggle Screen Reader On and Off" = "Meta+Alt+S"; @@ -20,38 +20,38 @@ "kmix"."increase_volume_small" = "Shift+Volume Up"; "kmix"."mic_mute" = ["Microphone Mute" "Meta+Volume Mute,Microphone Mute" "Meta+Volume Mute,Mute Microphone"]; "kmix"."mute" = "Volume Mute"; - "ksmserver"."Halt Without Confirmation" = [ ]; + "ksmserver"."Halt Without Confirmation" = []; "ksmserver"."Lock Session" = ["Meta+L" "" "Screensaver\\, ,Meta+L" "Screensaver,Lock Session"]; "ksmserver"."Log Out" = "Ctrl+Alt+Del"; - "ksmserver"."Log Out Without Confirmation" = [ ]; - "ksmserver"."LogOut" = [ ]; - "ksmserver"."Reboot" = [ ]; - "ksmserver"."Reboot Without Confirmation" = [ ]; - "ksmserver"."Shut Down" = [ ]; + "ksmserver"."Log Out Without Confirmation" = []; + "ksmserver"."LogOut" = []; + "ksmserver"."Reboot" = []; + "ksmserver"."Reboot Without Confirmation" = []; + "ksmserver"."Shut Down" = []; "kwin"."Activate Window Demanding Attention" = "Meta+Ctrl+A"; "kwin"."Cube" = "Ctrl+Meta+G"; - "kwin"."Cycle Overview" = [ ]; - "kwin"."Cycle Overview Opposite" = [ ]; - "kwin"."Decrease Opacity" = [ ]; + "kwin"."Cycle Overview" = []; + "kwin"."Cycle Overview Opposite" = []; + "kwin"."Decrease Opacity" = []; "kwin"."Edit Tiles" = "Meta+T"; "kwin"."Expose" = "Ctrl+F9"; "kwin"."ExposeAll" = ["Ctrl+F10" "" "Launch (C)\\, ,Ctrl+F10" "Launch (C),Toggle Present Windows (All desktops)"]; "kwin"."ExposeClass" = "Ctrl+F7"; - "kwin"."ExposeClassCurrentDesktop" = [ ]; + "kwin"."ExposeClassCurrentDesktop" = []; "kwin"."Grid View" = "Meta+G"; - "kwin"."Increase Opacity" = [ ]; - "kwin"."Invert Screen Colors" = [ ]; + "kwin"."Increase Opacity" = []; + "kwin"."Invert Screen Colors" = []; "kwin"."Kill Window" = "Meta+Ctrl+Esc"; - "kwin"."MinimizeAll" = [ ]; - "kwin"."Move Tablet to Next Output" = [ ]; + "kwin"."MinimizeAll" = []; + "kwin"."Move Tablet to Next Output" = []; "kwin"."MoveMouseToCenter" = "Meta+F6"; "kwin"."MoveMouseToFocus" = "Meta+F5"; - "kwin"."MoveZoomDown" = [ ]; - "kwin"."MoveZoomLeft" = [ ]; - "kwin"."MoveZoomRight" = [ ]; - "kwin"."MoveZoomUp" = [ ]; + "kwin"."MoveZoomDown" = []; + "kwin"."MoveZoomLeft" = []; + "kwin"."MoveZoomRight" = []; + "kwin"."MoveZoomUp" = []; "kwin"."Overview" = "Meta+W"; - "kwin"."Setup Window Shortcut" = [ ]; + "kwin"."Setup Window Shortcut" = []; "kwin"."Show Desktop" = "Meta+D"; "kwin"."Switch One Desktop Down" = "Meta+Ctrl+Down"; "kwin"."Switch One Desktop Up" = "Meta+Ctrl+Up"; @@ -62,134 +62,134 @@ "kwin"."Switch Window Right" = "Meta+Alt+Right"; "kwin"."Switch Window Up" = "Meta+Alt+Up"; "kwin"."Switch to Desktop 1" = "Ctrl+F1"; - "kwin"."Switch to Desktop 10" = [ ]; - "kwin"."Switch to Desktop 11" = [ ]; - "kwin"."Switch to Desktop 12" = [ ]; - "kwin"."Switch to Desktop 13" = [ ]; - "kwin"."Switch to Desktop 14" = [ ]; - "kwin"."Switch to Desktop 15" = [ ]; - "kwin"."Switch to Desktop 16" = [ ]; - "kwin"."Switch to Desktop 17" = [ ]; - "kwin"."Switch to Desktop 18" = [ ]; - "kwin"."Switch to Desktop 19" = [ ]; + "kwin"."Switch to Desktop 10" = []; + "kwin"."Switch to Desktop 11" = []; + "kwin"."Switch to Desktop 12" = []; + "kwin"."Switch to Desktop 13" = []; + "kwin"."Switch to Desktop 14" = []; + "kwin"."Switch to Desktop 15" = []; + "kwin"."Switch to Desktop 16" = []; + "kwin"."Switch to Desktop 17" = []; + "kwin"."Switch to Desktop 18" = []; + "kwin"."Switch to Desktop 19" = []; "kwin"."Switch to Desktop 2" = "Ctrl+F2"; - "kwin"."Switch to Desktop 20" = [ ]; + "kwin"."Switch to Desktop 20" = []; "kwin"."Switch to Desktop 3" = "Ctrl+F3"; "kwin"."Switch to Desktop 4" = "Ctrl+F4"; - "kwin"."Switch to Desktop 5" = [ ]; - "kwin"."Switch to Desktop 6" = [ ]; - "kwin"."Switch to Desktop 7" = [ ]; - "kwin"."Switch to Desktop 8" = [ ]; - "kwin"."Switch to Desktop 9" = [ ]; - "kwin"."Switch to Next Desktop" = [ ]; - "kwin"."Switch to Next Screen" = [ ]; - "kwin"."Switch to Previous Desktop" = [ ]; - "kwin"."Switch to Previous Screen" = [ ]; - "kwin"."Switch to Screen 0" = [ ]; - "kwin"."Switch to Screen 1" = [ ]; - "kwin"."Switch to Screen 2" = [ ]; - "kwin"."Switch to Screen 3" = [ ]; - "kwin"."Switch to Screen 4" = [ ]; - "kwin"."Switch to Screen 5" = [ ]; - "kwin"."Switch to Screen 6" = [ ]; - "kwin"."Switch to Screen 7" = [ ]; - "kwin"."Switch to Screen Above" = [ ]; - "kwin"."Switch to Screen Below" = [ ]; - "kwin"."Switch to Screen to the Left" = [ ]; - "kwin"."Switch to Screen to the Right" = [ ]; - "kwin"."Toggle" = [ ]; - "kwin"."Toggle Night Color" = [ ]; - "kwin"."Toggle Window Raise/Lower" = [ ]; - "kwin"."TrackMouse" = [ ]; + "kwin"."Switch to Desktop 5" = []; + "kwin"."Switch to Desktop 6" = []; + "kwin"."Switch to Desktop 7" = []; + "kwin"."Switch to Desktop 8" = []; + "kwin"."Switch to Desktop 9" = []; + "kwin"."Switch to Next Desktop" = []; + "kwin"."Switch to Next Screen" = []; + "kwin"."Switch to Previous Desktop" = []; + "kwin"."Switch to Previous Screen" = []; + "kwin"."Switch to Screen 0" = []; + "kwin"."Switch to Screen 1" = []; + "kwin"."Switch to Screen 2" = []; + "kwin"."Switch to Screen 3" = []; + "kwin"."Switch to Screen 4" = []; + "kwin"."Switch to Screen 5" = []; + "kwin"."Switch to Screen 6" = []; + "kwin"."Switch to Screen 7" = []; + "kwin"."Switch to Screen Above" = []; + "kwin"."Switch to Screen Below" = []; + "kwin"."Switch to Screen to the Left" = []; + "kwin"."Switch to Screen to the Right" = []; + "kwin"."Toggle" = []; + "kwin"."Toggle Night Color" = []; + "kwin"."Toggle Window Raise/Lower" = []; + "kwin"."TrackMouse" = []; "kwin"."Walk Through Windows" = "Alt+Tab"; "kwin"."Walk Through Windows (Reverse)" = "Alt+Shift+Tab"; - "kwin"."Walk Through Windows Alternative" = [ ]; - "kwin"."Walk Through Windows Alternative (Reverse)" = [ ]; + "kwin"."Walk Through Windows Alternative" = []; + "kwin"."Walk Through Windows Alternative (Reverse)" = []; "kwin"."Walk Through Windows of Current Application" = "Alt+`"; "kwin"."Walk Through Windows of Current Application (Reverse)" = "Alt+~"; - "kwin"."Walk Through Windows of Current Application Alternative" = [ ]; - "kwin"."Walk Through Windows of Current Application Alternative (Reverse)" = [ ]; - "kwin"."Window Above Other Windows" = [ ]; - "kwin"."Window Below Other Windows" = [ ]; + "kwin"."Walk Through Windows of Current Application Alternative" = []; + "kwin"."Walk Through Windows of Current Application Alternative (Reverse)" = []; + "kwin"."Window Above Other Windows" = []; + "kwin"."Window Below Other Windows" = []; "kwin"."Window Close" = "Alt+F4"; - "kwin"."Window Fullscreen" = [ ]; - "kwin"."Window Grow Horizontal" = [ ]; - "kwin"."Window Grow Vertical" = [ ]; - "kwin"."Window Lower" = [ ]; + "kwin"."Window Fullscreen" = []; + "kwin"."Window Grow Horizontal" = []; + "kwin"."Window Grow Vertical" = []; + "kwin"."Window Lower" = []; "kwin"."Window Maximize" = "Alt+Up"; - "kwin"."Window Maximize Horizontal" = [ ]; - "kwin"."Window Maximize Vertical" = [ ]; + "kwin"."Window Maximize Horizontal" = []; + "kwin"."Window Maximize Vertical" = []; "kwin"."Window Minimize" = "Meta+PgDown"; - "kwin"."Window Move" = [ ]; - "kwin"."Window Move Center" = [ ]; - "kwin"."Window No Border" = [ ]; - "kwin"."Window On All Desktops" = [ ]; + "kwin"."Window Move" = []; + "kwin"."Window Move Center" = []; + "kwin"."Window No Border" = []; + "kwin"."Window On All Desktops" = []; "kwin"."Window One Desktop Down" = "Meta+Ctrl+Shift+Down"; "kwin"."Window One Desktop Up" = "Meta+Ctrl+Shift+Up"; "kwin"."Window One Desktop to the Left" = "Meta+Ctrl+Shift+Left"; "kwin"."Window One Desktop to the Right" = "Meta+Ctrl+Shift+Right"; - "kwin"."Window One Screen Down" = [ ]; - "kwin"."Window One Screen Up" = [ ]; - "kwin"."Window One Screen to the Left" = [ ]; - "kwin"."Window One Screen to the Right" = [ ]; + "kwin"."Window One Screen Down" = []; + "kwin"."Window One Screen Up" = []; + "kwin"."Window One Screen to the Left" = []; + "kwin"."Window One Screen to the Right" = []; "kwin"."Window Operations Menu" = "Alt+F3"; - "kwin"."Window Pack Down" = [ ]; - "kwin"."Window Pack Left" = [ ]; - "kwin"."Window Pack Right" = [ ]; - "kwin"."Window Pack Up" = [ ]; + "kwin"."Window Pack Down" = []; + "kwin"."Window Pack Left" = []; + "kwin"."Window Pack Right" = []; + "kwin"."Window Pack Up" = []; "kwin"."Window Quick Tile Bottom" = "Meta+Down"; - "kwin"."Window Quick Tile Bottom Left" = [ ]; - "kwin"."Window Quick Tile Bottom Right" = [ ]; + "kwin"."Window Quick Tile Bottom Left" = []; + "kwin"."Window Quick Tile Bottom Right" = []; "kwin"."Window Quick Tile Left" = "Meta+Left"; "kwin"."Window Quick Tile Right" = "Meta+Right"; "kwin"."Window Quick Tile Top" = "Meta+Up"; - "kwin"."Window Quick Tile Top Left" = [ ]; - "kwin"."Window Quick Tile Top Right" = [ ]; - "kwin"."Window Raise" = [ ]; - "kwin"."Window Resize" = [ ]; - "kwin"."Window Shade" = [ ]; - "kwin"."Window Shrink Horizontal" = [ ]; - "kwin"."Window Shrink Vertical" = [ ]; - "kwin"."Window to Desktop 1" = [ ]; - "kwin"."Window to Desktop 10" = [ ]; - "kwin"."Window to Desktop 11" = [ ]; - "kwin"."Window to Desktop 12" = [ ]; - "kwin"."Window to Desktop 13" = [ ]; - "kwin"."Window to Desktop 14" = [ ]; - "kwin"."Window to Desktop 15" = [ ]; - "kwin"."Window to Desktop 16" = [ ]; - "kwin"."Window to Desktop 17" = [ ]; - "kwin"."Window to Desktop 18" = [ ]; - "kwin"."Window to Desktop 19" = [ ]; - "kwin"."Window to Desktop 2" = [ ]; - "kwin"."Window to Desktop 20" = [ ]; - "kwin"."Window to Desktop 3" = [ ]; - "kwin"."Window to Desktop 4" = [ ]; - "kwin"."Window to Desktop 5" = [ ]; - "kwin"."Window to Desktop 6" = [ ]; - "kwin"."Window to Desktop 7" = [ ]; - "kwin"."Window to Desktop 8" = [ ]; - "kwin"."Window to Desktop 9" = [ ]; - "kwin"."Window to Next Desktop" = [ ]; + "kwin"."Window Quick Tile Top Left" = []; + "kwin"."Window Quick Tile Top Right" = []; + "kwin"."Window Raise" = []; + "kwin"."Window Resize" = []; + "kwin"."Window Shade" = []; + "kwin"."Window Shrink Horizontal" = []; + "kwin"."Window Shrink Vertical" = []; + "kwin"."Window to Desktop 1" = []; + "kwin"."Window to Desktop 10" = []; + "kwin"."Window to Desktop 11" = []; + "kwin"."Window to Desktop 12" = []; + "kwin"."Window to Desktop 13" = []; + "kwin"."Window to Desktop 14" = []; + "kwin"."Window to Desktop 15" = []; + "kwin"."Window to Desktop 16" = []; + "kwin"."Window to Desktop 17" = []; + "kwin"."Window to Desktop 18" = []; + "kwin"."Window to Desktop 19" = []; + "kwin"."Window to Desktop 2" = []; + "kwin"."Window to Desktop 20" = []; + "kwin"."Window to Desktop 3" = []; + "kwin"."Window to Desktop 4" = []; + "kwin"."Window to Desktop 5" = []; + "kwin"."Window to Desktop 6" = []; + "kwin"."Window to Desktop 7" = []; + "kwin"."Window to Desktop 8" = []; + "kwin"."Window to Desktop 9" = []; + "kwin"."Window to Next Desktop" = []; "kwin"."Window to Next Screen" = "Meta+Shift+Right"; - "kwin"."Window to Previous Desktop" = [ ]; + "kwin"."Window to Previous Desktop" = []; "kwin"."Window to Previous Screen" = "Meta+Shift+Left"; - "kwin"."Window to Screen 0" = [ ]; - "kwin"."Window to Screen 1" = [ ]; - "kwin"."Window to Screen 2" = [ ]; - "kwin"."Window to Screen 3" = [ ]; - "kwin"."Window to Screen 4" = [ ]; - "kwin"."Window to Screen 5" = [ ]; - "kwin"."Window to Screen 6" = [ ]; - "kwin"."Window to Screen 7" = [ ]; + "kwin"."Window to Screen 0" = []; + "kwin"."Window to Screen 1" = []; + "kwin"."Window to Screen 2" = []; + "kwin"."Window to Screen 3" = []; + "kwin"."Window to Screen 4" = []; + "kwin"."Window to Screen 5" = []; + "kwin"."Window to Screen 6" = []; + "kwin"."Window to Screen 7" = []; "kwin"."view_actual_size" = ",Meta+0,Zoom to Actual Size"; "kwin"."view_zoom_in" = ["Meta++" "Meta+=,Meta++" "Meta+=,Zoom In"]; "kwin"."view_zoom_out" = "Meta+-"; - "mediacontrol"."mediavolumedown" = [ ]; - "mediacontrol"."mediavolumeup" = [ ]; + "mediacontrol"."mediavolumedown" = []; + "mediacontrol"."mediavolumeup" = []; "mediacontrol"."nextmedia" = "Media Next"; "mediacontrol"."pausemedia" = "Media Pause"; - "mediacontrol"."playmedia" = [ ]; + "mediacontrol"."playmedia" = []; "mediacontrol"."playpausemedia" = "Media Play"; "mediacontrol"."previousmedia" = "Media Previous"; "mediacontrol"."stopmedia" = "Media Stop"; @@ -204,9 +204,9 @@ "org_kde_powerdevil"."PowerOff" = "Power Off"; "org_kde_powerdevil"."Sleep" = "Sleep"; "org_kde_powerdevil"."Toggle Keyboard Backlight" = "Keyboard Light On/Off"; - "org_kde_powerdevil"."Turn Off Screen" = [ ]; + "org_kde_powerdevil"."Turn Off Screen" = []; "org_kde_powerdevil"."powerProfile" = ["Battery" "" "Meta+B\\, ,Battery" "Meta+B,Switch Power Profile"]; - "plasmashell"."activate application launcher" = ["Meta" "" "Alt+F1\\, ,Meta" "Alt+F1,Activate Application Launcher"]; + "plasmashell"."activate application launcher" = ["Alt+F1" "Alt+F1,Activate Application Launcher"]; "plasmashell"."activate task manager entry 1" = "Meta+1"; "plasmashell"."activate task manager entry 10" = "\\, Meta+0\\, ,Meta+0,Activate Task Manager Entry 10"; "plasmashell"."activate task manager entry 2" = "Meta+2"; @@ -223,29 +223,29 @@ "plasmashell"."cycleNextAction" = "none,,Next History Item"; "plasmashell"."cyclePrevAction" = "none,,Previous History Item"; "plasmashell"."manage activities" = "Meta+Q"; - "plasmashell"."next activity" = [ ]; - "plasmashell"."previous activity" = [ ]; + "plasmashell"."next activity" = []; + "plasmashell"."previous activity" = []; "plasmashell"."repeat_action" = "Meta+Ctrl+R"; "plasmashell"."show dashboard" = "Ctrl+F12"; - "plasmashell"."show-barcode" = [ ]; + "plasmashell"."show-barcode" = []; "plasmashell"."show-on-mouse-pos" = "Meta+V"; "plasmashell"."stop current activity" = "Meta+S"; - "plasmashell"."switch to next activity" = [ ]; - "plasmashell"."switch to previous activity" = [ ]; - "plasmashell"."toggle do not disturb" = [ ]; + "plasmashell"."switch to next activity" = []; + "plasmashell"."switch to previous activity" = []; + "plasmashell"."toggle do not disturb" = []; "services/alacritty.desktop"."_launch" = "Alt+Q"; "services/lookandfeeltool-4.desktop"."_launch" = "Ctrl+F12"; - "services/org.kde.konsole.desktop"."_launch" = [ ]; + "services/org.kde.konsole.desktop"."_launch" = []; "services/org.kde.plasma-systemmonitor.desktop"."_launch" = ["Ctrl+Shift+Esc" "Meta+Esc"]; - "services/org.kde.spectacle.desktop"."ActiveWindowScreenShot" = [ ]; - "services/org.kde.spectacle.desktop"."FullScreenScreenShot" = [ ]; - "services/org.kde.spectacle.desktop"."RecordRegion" = [ ]; - "services/org.kde.spectacle.desktop"."RecordScreen" = [ ]; - "services/org.kde.spectacle.desktop"."RecordWindow" = [ ]; + "services/org.kde.spectacle.desktop"."ActiveWindowScreenShot" = []; + "services/org.kde.spectacle.desktop"."FullScreenScreenShot" = []; + "services/org.kde.spectacle.desktop"."RecordRegion" = []; + "services/org.kde.spectacle.desktop"."RecordScreen" = []; + "services/org.kde.spectacle.desktop"."RecordWindow" = []; "services/org.kde.spectacle.desktop"."RectangularRegionScreenShot" = "Meta+Shift+S"; - "services/org.kde.spectacle.desktop"."WindowUnderCursorScreenShot" = [ ]; - "services/org.kde.spectacle.desktop"."_launch" = [ ]; - "services/systemsettings.desktop"."_launch" = [ ]; + "services/org.kde.spectacle.desktop"."WindowUnderCursorScreenShot" = []; + "services/org.kde.spectacle.desktop"."_launch" = []; + "services/systemsettings.desktop"."_launch" = []; }; configFile = { "baloofilerc"."Basic Settings"."Indexing-Enabled" = false; diff --git a/modules/wm/plasma/default.nix b/modules/wm/plasma/default.nix new file mode 100644 index 0000000..0e210f0 --- /dev/null +++ b/modules/wm/plasma/default.nix @@ -0,0 +1,39 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.wm.plasma; +in { + options = { + horseman.wm.plasma = { + enable = mkEnableOption "Plasma 6"; + }; + }; + + config = { + services = { + xserver.enable = true; + + desktopManager.plasma6.enable = true; + displayManager = { + sddm.autoNumlock = true; + }; + + power-profiles-daemon.enable = true; + }; + + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + kate + konsole + ]; + + home-manager.users.horseman = { + imports = [./config.nix]; + }; + }; +} diff --git a/modules/wm/qtile/config/LICENSE b/modules/wm/qtile/config/LICENSE new file mode 100644 index 0000000..86336ad --- /dev/null +++ b/modules/wm/qtile/config/LICENSE @@ -0,0 +1,20 @@ +MIT License + +Copyright (c) 2020 Daniel Diaz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE diff --git a/modules/wm/qtile/config/README.md b/modules/wm/qtile/config/README.md new file mode 100644 index 0000000..fb552a7 --- /dev/null +++ b/modules/wm/qtile/config/README.md @@ -0,0 +1,91 @@ +# Qtile configuration file + +## Screenshots 🖥️ + +![Qtile Screenshots](../assets/Remake-1.png) + +![Qtile Screenshots](../assets/Remake-2.png) + +![Qtile Screenshots](../assets/REMAKE-3.png) + +## What is Qtile? + +[Qtile](http://www.qtile.org/) is a window manager written and configured in Python🐍. It is hackable and lightweight, you can install it among other desktop environments and [standalone WM's](https://wiki.archlinux.org/index.php/window_manager). + +## Installation 🐧 + +Install Qtile and other dependencies. + +### For Arch Linux +All software, one command: + +```bash +yay -S qtile picom rofi nitrogen xorg-server-xephyr +lxappearance-gtk3 megasync python-psutil brave-browser alacritty +bat playerctl pulseaudio-ctl dunst alacritty fish starship neovim +pavucontrol flameshot noto-fonts-emoji noto-fonts-emoji brightnessctl blueman xfce4-power-manager network-manager-applet xfce4-clipman-plugin +``` + +Also install Rofi Power menu: +``` +git clone git@github.com:jluttine/rofi-power-menu.git +cp rofi-power-menu ~/.local/bin/ +``` + +The [xephyr](https://wiki.archlinux.org/index.php/Xephyr) package is for testing purposes. + +[Nitrogen](https://wiki.archlinux.org/index.php/nitrogen) help us to set a cool wallpaper since Qtile doesn't have a wallpaper manager by default. + +### For Debian, Ubuntu + +For Debian, Ubuntu and derivates [here](http://docs.qtile.org/en/latest/manual/install/ubuntu.html) is the qtile installation guide. + +#### Dependencies + +``` +sudo apt install picom rofi xserver-xephyr nitrogen +``` + +## Cloning the config files 📁 + +``` +git clone git@github.com:DaniDiazTech/Qtile-Config.git ~/.config/qtile +``` + +## Testing 🧪 + +If you want to test the config files without crashing your current qtile instance, type the following commands: + +``` +Xephyr -br -ac -noreset -screen 1280x720 :1 & +DISPLAY=:1 qtile "/PATH/TO/TEST-CONFIG" +``` + +Once you've done all these steps you should have a cool Qtile instance, but most keybindings won't work, because probably you don´t have the software I use, you could install [my software](https://github.com/DaniDiazTech/Qtile-Config/blob/main/software.txt) or re-map the keybindings in [keybindings.py](https://github.com/Daniel1404/Qtile-Config/blob/main/keybindings.py) file. + +## Startup 🏁 + +One of the most important functions in the config is the startup function located at the bottom of _config.py_. + +``` python +@hook.subscribe.startup_once +def start_once(): + home = os.path.expanduser('~') + subprocess.call([home + '/.config/qtile/autostart.sh']) +``` + +You can manage the autostart applications editing the _autostart.sh_ file. + +``` bash +#! /bin/bash +picom --experimental-backend & +nitrogen --restore & +``` + +You can setup your Qtile instance quickly using the `setup.py` file: + +```python +python setup.py +``` + +Remember to set a wallpaper with nitrogen so every time you boot into Qtile, your wallpaper will be restored. diff --git a/modules/wm/qtile/config/config.py b/modules/wm/qtile/config/config.py new file mode 100644 index 0000000..69d4c73 --- /dev/null +++ b/modules/wm/qtile/config/config.py @@ -0,0 +1,104 @@ +############################################### +### QTILE CONFIGURATION FILE OF DANIEL DIAZ ### +# +# ____ ____ +# | _ \ | _ \ Copyright (c) 2020 Daniel Diaz +# | | | || | | | +# | |_| || |_| | http://www.github.com/DaniDiazTech/ +# |____/ |____/ +# + + +####### IMPORTS ######### +import os +import subprocess + + +# from typing import List # noqa: F401 + +from libqtile import hook, layout +from libqtile.config import Group, Match + +# Local Files +from keys.keybindings import Mouse,Keybindings + +from widgets import MyWidgets +from layouts import Layouts +from groups import CreateGroups +from icons import group_icons + + +###### MAIN ###### +if __name__ in ["config", "__main__"]: + # Initializes objects + + # Initializes keybindings + obj_keys = Keybindings() + + # Mouse + obj_mouse = Mouse() + obj_widgets = MyWidgets() + obj_layouts = Layouts() + obj_groups = CreateGroups() + + # Initializes qtile variables + keys = obj_keys.init_keys() + mouse = obj_mouse.init_mouse() + layouts = obj_layouts.init_layouts() + groups = obj_groups.init_groups() + + # Append group keys for groups + keys += obj_keys.init_keys_groups(group_icons) + + ### DISPLAYS WIDGETS IN THE SCREEN #### + + screens = obj_widgets.init_screen() + main_widgets_list = obj_widgets.init_widgets_list() + widgets_screen1 = obj_widgets.init_widgets_screen() + + + +dgroups_key_binder = None + +dgroups_app_rules = [] # type: list + +follow_mouse_focus = True + +bring_front_click = False + +cursor_warp = False + + +floating_layout = layout.Floating(float_rules=[ + # Run the utility of `xprop` to see the wm class and name of an X client. + *layout.Floating.default_float_rules, + Match(wm_class='confirmreset'), # gitk + Match(wm_class='dialog'), # Dialogs stuff + Match(wm_class='makebranch'), # gitk + Match(wm_class='maketag'), # gitk + Match(wm_class='ssh-askpass'), # ssh-askpass + Match(title='branchdialog'), # gitk + Match(title='pinentry'), # GPG key password entry +]) +auto_fullscreen = True + +focus_on_window_activation = "smart" + +reconfigure_screens = True + +# If things like steam games want to auto-minimize themselves when losing +# focus, should we respect this or not? +respect_minimize_requests = True + +# XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this +wmname = "LG3D" + +@hook.subscribe.startup_once +def start_once(): + home = os.path.expanduser('~') + subprocess.call([home + '/.local/bin/autostart']) + +@hook.subscribe.client_new +def dialogs(window): + if(window.window.get_wm_type() == 'dialog' or window.window.get_wm_transient_for()): + window.floating = True \ No newline at end of file diff --git a/modules/wm/qtile/config/config_keybindings.py b/modules/wm/qtile/config/config_keybindings.py new file mode 100644 index 0000000..6d252da --- /dev/null +++ b/modules/wm/qtile/config/config_keybindings.py @@ -0,0 +1,117 @@ +""" +MODIFY THIS FILE TO CREATE CUSTOM KEYBINDINGS + +Keybindings are configured with tuples, inside Predifined lists Variables + +Modifier -> list() -> Ex: [MOD, CONTROL] + +Key -> str() -> Ex: 'j' + +Command -> str() -> Ex: vscode + +(Modifier, Key, Command) +""" + +from libqtile.confreader import ConfigError + +# Import default mod keys +from keys.default import * + +from functions import PWA + +from os.path import expanduser + +HOME = expanduser("~") + +# Define constants here +TERMINAL = "alacritty" + + +# Basic window manager movements + + +# Qtile shutdown/restart keys +SHUTDOWN_MODIFIER = [MOD, CONTROL] +RESTART = "r" +SHUTDOWN = "q" + + +# Group movement keys: +GROUPS_KEY = CONTROL +SWAP_GROUP_KEY = SHIFT + +NEXT_GROUP = "period" +PREV_GROUP = "comma" + + +# ------------ Hardware Configs ------------ +HARDWARE_KEYS = [ + # (Modifier, Key, Command) + + # Volume + ([], "XF86AudioLowerVolume", "pactl set-sink-volume @DEFAULT_SINK@ -5%"), + ([], "XF86AudioRaiseVolume", "pactl set-sink-volume @DEFAULT_SINK@ +5%"), + ([], "XF86AudioMute", "pactl set-sink-mute @DEFAULT_SINK@ toggle"), + + # Brightness + ([], "XF86MonBrightnessUp", "brightnessctl set +5%"), + ([], "XF86MonBrightnessDown", "brightnessctl set 5%-"), +] + + +APPS = [ + ([MOD], "Return", TERMINAL), + # (Modifier, Key, Command) + ([MOD], "e", "thunar"), + ([MOD, ALT], "d", "emacs"), + ([MOD, ALT], "o", "env LIBGL_ALWAYS_SOFTWARE=1 obs"), + ([MOD, ALT], "v", "gvim"), + ([MOD, ALT], "b", "brave"), + ([MOD, ALT], "c", "code"), + ([MOD, ALT], "p", "pycharm"), + ([MOD, ALT], "a", "pavucontrol"), + ([MOD, ALT], "e", "vim -g .config/qtile/config.py"), + ([MOD, ALT], "z", "zoom"), + + # Media hotkeys + ([MOD], "Up", "pulseaudio-ctl up 5"), + ([MOD], "Down", "pulseaudio-ctl down 5"), + + # Makes reference to play-pause script + # You can find it in my scripts repository + ([ALTGR], "space", "play-pause"), + + # Run "rofi-theme-selector" in terminal to select a theme + ([MOD], "space", 'rofi -modi "drun,power-menu:rofi-power-menu,run,window,ssh" -show drun -show-icons'), + + # Screenshots + ([], "Print", "xfce4-screenshooter"), + # Full screen screenshot + ([ALT], "Print", "xfce4-screenshooter -f -c"), + + # Terminal apps + ([MOD, ALT], "n", TERMINAL + " -e nvim"), + +] + +########################## +# Your custom keys here # +########################## + +CUSTOM_SPAWN_KEYS = [ + # PWA keys + ([MOD, ALT], "s", PWA.spotify()), + ([MOD, ALT], "m", PWA.music()), + ([MOD, ALT], "t", PWA.calendar()), + ([MOD, ALT], "y", PWA.youtube()), + ([MOD, ALT], "l", PWA.notion()), + ([MOD, ALT], "h", PWA.habitica()), +] + + +SPAWN_KEYS = HARDWARE_KEYS + APPS + CUSTOM_SPAWN_KEYS + +SPAWN_CMD_KEYS = [ + # Takes full screenshot and creates a file on the screenshot folder + ([SHIFT], "Print", f"xfce4-screenshooter -f -s {HOME}/Pictures/Screenshots/"), +] diff --git a/modules/wm/qtile/config/functions.py b/modules/wm/qtile/config/functions.py new file mode 100644 index 0000000..e1de5b2 --- /dev/null +++ b/modules/wm/qtile/config/functions.py @@ -0,0 +1,85 @@ +from libqtile.lazy import lazy +# from libqtile.command_client import InteractiveCommandClient + + +class Functions: + + ##### MOVE WINDOW IN GROUPS ##### + + @staticmethod + def window_to_prev_group(): + @lazy.function + def __inner(qtile): + i = qtile.groups.index(qtile.current_group) + + if qtile.current_window and i != 0: + group = qtile.groups[i - 1].name + qtile.current_window.togroup(group, switch_group=True) + + return __inner + + @staticmethod + def window_to_next_group(): + @lazy.function + def __inner(qtile): + i = qtile.groups.index(qtile.current_group) + + if qtile.current_window and i != len(qtile.groups): + group = qtile.groups[i + 1].name + qtile.current_window.togroup(group, switch_group=True) + + return __inner + + ##### KILL ALL WINDOWS ##### + + @staticmethod + def kill_all_windows(): + @lazy.function + def __inner(qtile): + for window in qtile.current_group.windows: + window.kill() + + return __inner + + @staticmethod + def kill_all_windows_minus_current(): + @lazy.function + def __inner(qtile): + for window in qtile.current_group.windows: + if window != qtile.current_window: + window.kill() + + return __inner + + +class PWA: + def __init__(self): + pass + + @staticmethod + def notion(): + return "brave --profile-directory=Default --app=https://notion.so" + + @staticmethod + def music(): + return "brave --profile-directory=Default --app=https://music.youtube.com/" + + @staticmethod + def spotify(): + return "brave --profile-directory=Default --app=https://open.spotify.com/" + + @staticmethod + def youtube(): + return "brave --user-data-dir=Default --app=https://www.youtube.com" + + @staticmethod + def calendar(): + return "brave --profile-directory=Default --app=https://calendar.google.com/calendar/" + + @staticmethod + def habitica(): + return "brave --profile-directory=Default --app=https://habitica.com/" + + +if __name__ == "__main__": + print("This is an utilities module") diff --git a/modules/wm/qtile/config/groups.py b/modules/wm/qtile/config/groups.py new file mode 100644 index 0000000..b0b4d9f --- /dev/null +++ b/modules/wm/qtile/config/groups.py @@ -0,0 +1,17 @@ +from libqtile.config import Group +from icons import group_icons + +class CreateGroups: + group_names = group_icons + + def init_groups(self): + """ + Return the groups of Qtile + """ + #### First and last + groups = [Group(name, layout="max") if name == self.group_names[0] + else Group(name, layout="floating") + if name == self.group_names[-1] else Group(name, layout="monadtall") + for name in self.group_names] + return groups + diff --git a/modules/wm/qtile/config/icons.py b/modules/wm/qtile/config/icons.py new file mode 100644 index 0000000..9e90130 --- /dev/null +++ b/modules/wm/qtile/config/icons.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + + +# You can define a letter and its icon here +group_icons = ["B  ", + "D  ", + "T  ", + "V  ", + "M  ", + "C  ", + "E  ", + "N  ", + ] + diff --git a/modules/wm/qtile/config/icons/layout-floating.png b/modules/wm/qtile/config/icons/layout-floating.png new file mode 100644 index 0000000..e876b13 Binary files /dev/null and b/modules/wm/qtile/config/icons/layout-floating.png differ diff --git a/modules/wm/qtile/config/icons/layout-max.png b/modules/wm/qtile/config/icons/layout-max.png new file mode 100644 index 0000000..889bc78 Binary files /dev/null and b/modules/wm/qtile/config/icons/layout-max.png differ diff --git a/modules/wm/qtile/config/icons/layout-monadtall.png b/modules/wm/qtile/config/icons/layout-monadtall.png new file mode 100644 index 0000000..cf84fb8 Binary files /dev/null and b/modules/wm/qtile/config/icons/layout-monadtall.png differ diff --git a/modules/wm/qtile/config/icons/layout-tile.png b/modules/wm/qtile/config/icons/layout-tile.png new file mode 100644 index 0000000..74cd1e7 Binary files /dev/null and b/modules/wm/qtile/config/icons/layout-tile.png differ diff --git a/modules/wm/qtile/config/icons/layout-treetab.png b/modules/wm/qtile/config/icons/layout-treetab.png new file mode 100644 index 0000000..bd9c396 Binary files /dev/null and b/modules/wm/qtile/config/icons/layout-treetab.png differ diff --git a/modules/wm/qtile/config/icons/python.png b/modules/wm/qtile/config/icons/python.png new file mode 100644 index 0000000..bd02fea Binary files /dev/null and b/modules/wm/qtile/config/icons/python.png differ diff --git a/modules/wm/qtile/config/icons/terminal-iconx14.png b/modules/wm/qtile/config/icons/terminal-iconx14.png new file mode 100644 index 0000000..84bcb4f Binary files /dev/null and b/modules/wm/qtile/config/icons/terminal-iconx14.png differ diff --git a/modules/wm/qtile/config/icons/terminal-iconx24.png b/modules/wm/qtile/config/icons/terminal-iconx24.png new file mode 100644 index 0000000..687bafb Binary files /dev/null and b/modules/wm/qtile/config/icons/terminal-iconx24.png differ diff --git a/modules/wm/qtile/config/keys/assets.py b/modules/wm/qtile/config/keys/assets.py new file mode 100644 index 0000000..edc45f7 --- /dev/null +++ b/modules/wm/qtile/config/keys/assets.py @@ -0,0 +1,4 @@ +def create_keybinding(): + """ + Returns a key object based on a dictionary + """ \ No newline at end of file diff --git a/modules/wm/qtile/config/keys/default.py b/modules/wm/qtile/config/keys/default.py new file mode 100644 index 0000000..0b98b24 --- /dev/null +++ b/modules/wm/qtile/config/keys/default.py @@ -0,0 +1,60 @@ +"""Qtile default keybindings""" + +# Keys +MOD = "mod4" +ALT = "mod1" +ALTGR = "mod5" +SHIFT = "shift" +CONTROL = "control" + +# Basic wm bindings + +# All of these variables include the MOVEMENT_KEYS at the start + +# The key which the WM will use to move the layouts +MOVEMENT_KEY = MOD +KILL_KEY = MOD + +SWAP_KEY = SHIFT +FLOATING_KEY = SHIFT + + +############ BINDINGS FOR MONADTALL ############## +# Move between windows +LEFT = "h" +RIGHT = "l" +DOWN = "j" +UP = "k" + +# Swap windows +SWAP_LEFT = "h" +SWAP_RIGHT = "l" +SWAP_DOWN = "j" +SWAP_UP = "k" + +SWAP_FLIP = "space" # Flip the layout + +########### LAYOUTS ############### +# Change windows lenght +GROW = "i" +SHRINK = "m" +NORMALIZE = "n" +MAXIMIZE = "o" + +# Floating layout +TOOGLE_FLOATING = "f" +TOOGLE_FULL = "g" + +# Groups key +# Move screen to next and previous group +NEXT = "k" +PREVIOUS = "j" + +# Kill Functions +KILL_CURRENT = "w" +KILL_ALL = "x" +KILL_ALL_MINUS_CURRENT = "c" + +# Rotates layouts + +TOOGLE_LAYOUT = "Tab" \ No newline at end of file diff --git a/modules/wm/qtile/config/keys/keybindings.py b/modules/wm/qtile/config/keys/keybindings.py new file mode 100644 index 0000000..f4bfd0f --- /dev/null +++ b/modules/wm/qtile/config/keys/keybindings.py @@ -0,0 +1,165 @@ + +from libqtile.config import Click, Drag, Key +from libqtile.lazy import lazy + +# Import the function that move the window to the next and prev group +from functions import Functions, PWA + +from config_keybindings import * + + +class Keybindings: + + keys = [] + + spawn_keys = SPAWN_KEYS + + cmd_keys = SPAWN_CMD_KEYS + + def create_layout_keys(self): + ############ BINDINGS FOR MONADTALL ############## + modifier = [MOVEMENT_KEY] + + layout_left = Key(modifier, LEFT, lazy.layout.left()) + + layout_right = Key(modifier, RIGHT, lazy.layout.right()) + + layout_down = Key(modifier, DOWN, lazy.layout.down()) + + layout_up = Key(modifier, UP, lazy.layout.up()) + + toogle_layout = Key(modifier, TOOGLE_LAYOUT, lazy.next_layout()) + + self.keys += [layout_left, layout_right, layout_down, layout_up, toogle_layout] + + def create_swap_keys(self): + modifier = [MOVEMENT_KEY, SWAP_KEY] + + left = Key(modifier, SWAP_LEFT, lazy.layout.swap_left()) + right = Key(modifier, SWAP_RIGHT, lazy.layout.swap_right()) + down = Key(modifier, SWAP_DOWN, lazy.layout.shuffle_down()) + up = Key(modifier, SWAP_UP, lazy.layout.shuffle_up()) + + flip = Key(modifier, SWAP_FLIP, lazy.layout.flip()) + + self.keys += [left, right, down, up, flip] + + + def create_windows_keys(self): + + modifier = [MOVEMENT_KEY] + + grow = Key(modifier, GROW, lazy.layout.grow()) + shrink = Key(modifier, SHRINK, lazy.layout.shrink()) + normalize = Key(modifier, NORMALIZE, lazy.layout.normalize()) + maximize = Key(modifier, MAXIMIZE, lazy.layout.maximize()) + + self.keys += [grow, shrink, normalize, maximize] + + def create_shutdown_keys(self): + + shutdown = Key(SHUTDOWN_MODIFIER, SHUTDOWN, lazy.shutdown()) + restart = Key(SHUTDOWN_MODIFIER, RESTART, lazy.restart()) + + self.keys += [shutdown, restart] + + def create_kill_keys(self): + modifier = [MOVEMENT_KEY, ALTGR] + + all_minus_current = Key(modifier, KILL_ALL_MINUS_CURRENT, + Functions.kill_all_windows_minus_current()) + all_ = Key(modifier, KILL_ALL, + Functions.kill_all_windows()) + current = Key([KILL_KEY], KILL_CURRENT, + lazy.window.kill()) + + self.keys += [all_minus_current, all_, current] + + def create_floating_keys(self): + + modifier = [MOVEMENT_KEY, FLOATING_KEY] + + floating = Key(modifier, TOOGLE_FLOATING, lazy.window.toggle_floating()) + full = Key(modifier, TOOGLE_FULL, lazy.window.toggle_fullscreen()) + + self.keys += [floating, full] + + def create_groups_keys(self): + modifier = [GROUPS_KEY] + swap_modifier = [GROUPS_KEY, SWAP_GROUP_KEY] + screen_modifier = [MOVEMENT_KEY] + + move_next = Key(modifier, NEXT_GROUP, lazy.screen.next_group()) + move_prev = Key(modifier, PREV_GROUP, lazy.screen.prev_group()) + + swap_next = Key(swap_modifier, NEXT_GROUP, Functions.window_to_next_group()) + swap_prev = Key(swap_modifier, PREV_GROUP, Functions.window_to_prev_group()) + + move_next_screen = Key(screen_modifier, NEXT_GROUP, lazy.next_screen()) + move_prev_screen = Key(screen_modifier, PREV_GROUP, lazy.next_screen()) + + self.keys += [move_next, move_prev, swap_next, swap_prev, move_next_screen, move_prev_screen] + + def create_spawn_keys(self): + + for spawn_key in self.spawn_keys: + + modifier, key, command = spawn_key + + keybinding = Key(modifier, key, lazy.spawn(command)) + + self.keys.append(keybinding) + + def create_cmd_keys(self): + + for cmd_key in self.cmd_keys: + + modifier, key, command = cmd_key + + keybinding = Key(modifier, key, lazy.spawncmd(command)) + + self.keys.append(keybinding) + + + def init_keys_groups(self, group_names): + """ + Create bindings to move between groups + """ + group_keys = [] + for icon in group_names: + index = (icon[0]).lower() + + group_keys += [Key([MOVEMENT_KEY, GROUPS_KEY], index, lazy.group[icon].toscreen()), Key( + [MOVEMENT_KEY, SWAP_GROUP_KEY], index, lazy.window.togroup(icon, switch_group=True))] + + return group_keys + + def init_keys(self): + + self.create_layout_keys() + self.create_swap_keys() + self.create_windows_keys() + self.create_shutdown_keys() + self.create_kill_keys() + self.create_floating_keys() + self.create_groups_keys() + + self.create_cmd_keys() + self.create_spawn_keys() + + return self.keys + + +class Mouse: + def __init__(self, mod_key=MOD): + self.mod = mod_key + + def init_mouse(self): + mouse = [ + Drag([self.mod], "Button1", lazy.window.set_position_floating(), + start=lazy.window.get_position()), + Drag([self.mod], "Button3", lazy.window.set_size_floating(), + start=lazy.window.get_size()), + Click([self.mod], "Button2", lazy.window.bring_to_front()) + ] + return mouse diff --git a/modules/wm/qtile/config/keys/print_keybindings.py b/modules/wm/qtile/config/keys/print_keybindings.py new file mode 100644 index 0000000..ff00751 --- /dev/null +++ b/modules/wm/qtile/config/keys/print_keybindings.py @@ -0,0 +1,15 @@ +""" +Script that automates the process of writing a keybindings.md +By directly getting the keybindings from keybindings.py +""" + +# Local import +from keybindings import Keybindings + +def get_keybindings(): + current_keybindings = Keybindings() + list_of_keys = list(current_keybindings.init_keys()) + return list_of_keys + + +print(*get_keybindings(), sep="\n") diff --git a/modules/wm/qtile/config/layouts.py b/modules/wm/qtile/config/layouts.py new file mode 100644 index 0000000..dcd6af1 --- /dev/null +++ b/modules/wm/qtile/config/layouts.py @@ -0,0 +1,51 @@ +from libqtile import layout + + +class Layouts: + def __init__(self): + self.default = { + "border_width": 2, + "margin": 8, + "border_focus": "#668bd7", + "border_normal": "1D2330"} + + def init_layouts(self): + """ + Returns the layouts variable + """ + layouts = [ + layout.Max(**self.default), + layout.MonadTall(**self.default), + layout.floating.Floating(**self.default), + layout.TreeTab( + font="Ubuntu", + fontsize=10, + sections=["FIRST", "SECOND", "THIRD", "FOURTH"], + section_fontsize=10, + border_width=2, + bg_color="1c1f24", + active_bg="c678dd", + active_fg="000000", + inactive_bg="a9a1e1", + inactive_fg="1c1f24", + padding_left=0, + padding_x=0, + padding_y=5, + section_top=10, + section_bottom=20, + level_shift=8, + vspace=3, + panel_width=200 + ), + # layout.Stack(num_stacks=2), + # Try more layouts by unleashing below layouts. + # layout.Bsp(), + # layout.Columns(), + # layout.Matrix(), + # layout.MonadWide(**self.default), + # layout.RatioTile(), + # layout.Tile(), + # layout.VerticalTile(), + # layout.Zoomy(), + ] + return layouts diff --git a/modules/wm/qtile/config/scripts/autostart.sh b/modules/wm/qtile/config/scripts/autostart.sh new file mode 100755 index 0000000..9a6eeca --- /dev/null +++ b/modules/wm/qtile/config/scripts/autostart.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# --- +# Use "run program" to run it only if it is not already running +# Use "program &" to run it regardless +# --- +# NOTE: This script runs with every restart of AwesomeWM +# TODO: run_once + + +function run { + if ! pgrep $1 > /dev/null ; + then + $@& + fi +} + +run picom -CGb & +run nitrogen --restore & +run /usr/lib/polkit-kde-authentication-agent-1 & +run megasync +run xfce4-clipman +run xfce4-power-manager +run gammy +run dunst +run nm-applet +run blueman-applet diff --git a/modules/wm/qtile/config/scripts/play-pause.sh b/modules/wm/qtile/config/scripts/play-pause.sh new file mode 100755 index 0000000..0eabf52 --- /dev/null +++ b/modules/wm/qtile/config/scripts/play-pause.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +playerctl play-pause + diff --git a/modules/wm/qtile/config/setup.py b/modules/wm/qtile/config/setup.py new file mode 100755 index 0000000..bfae889 --- /dev/null +++ b/modules/wm/qtile/config/setup.py @@ -0,0 +1,225 @@ +# /usr/bin/python + +# Os level operations +import os +from getpass import getuser + +# Determinates if the program is installed +from shutil import which + +# Get the OS I'm in +import platform + +INSTALL_PATH = ".local/bin" + + +def print_program_welcome(): + + row = "=" * 55 + + sep = "||" + + welcome = "SETUP SCRIPT OF DANIEL'S QTILE CONFIG".center(len(row) - len(sep) * 2) + + welcome = sep + welcome + sep + + + print(row) + + print("") + + + print(welcome) + + print("") + + print(row + "\n") + + print(f"Hi there {getuser()}, you are about to setup Qtile".center(len(row))) + + print("\n" + row) + + +def print_current_dir(): + print(f"Currently you are in {os.getcwd()} directory") + +def get_correct_os(): + """ + Returns the Os name: + + get_os -> bool + + Linux: linux + Mac: darwin + Windows: windows + """ + os = platform.system().lower() + + return os == "linux" + + +def get_home_path(): + """ + Get Linux home path + + get_home_path -> str + """ + return os.path.expanduser("~") + +def get_local_bin(home): + """ + Returns the local bin path of the User + """ + return f"{home}/.local/bin" + +def check_local_folder_exists(): + """ + Check if .local/bin exists + """ + home = get_home_path() + + local = get_local_bin(home) + + return os.path.exists(local) + + +def create_local_install_folder(local_bin): + """ + Creates local bin folder + """ + print("") + print(f"Creating folder ar {local_bin}") + print("") + + try: + os.mkdir(local_bin) + except OSError: + raise OSError(f"Creation of the directory {local_bin} failed") + else: + print(f"Successfully created the directory {local_bin}") + +def get_response(message="yes/no"): + """ + returns -> bool + """ + while True: + response = input(message).lower() + + if response == "yes": + return True + elif response == "no": + return False + else: + print("\nSorry your response must be yes or no\n") + continue + + +LOCAL_BIN = get_local_bin(get_home_path()) + +def link_scripts(path): + + path = os.path.abspath(path) + if not os.path.exists(path): + raise OSError("Sorry that path doesn't exist") + + + os.chdir(path) + + i = 0 + + + for file_ in os.listdir(path): + file_path = os.path.abspath(file_) + + file_name = file_.split(".")[0] + + link_path = LOCAL_BIN + f"/{file_name}" + + if os.path.exists(link_path): + print("You have already in path", file_name) + continue + + os.link(file_path, link_path) + + i += 1 + + return f"Linked {i} files to .local/bin" + + +def get_dependencies(software_path="software.txt"): + """software_path -> path of software.txt + + returns list of dependencies + """ + + if not os.path.exists(software_path): + print(f"The file {software_path} wasn't found. Please clone again or provide one") + + if get_response("Continue without dependencies warnings? [yes/no]"): + print("Dependencies won't be shown") + return None + else: + print("Clone again or provide a file.") + exit() + + software = [] + + with open(software_path, "r") as file_: + for line in file_: + software.append(line.strip()) + + return software + +def check_dependencies(dependencies=None): + """dependencies -> list + + returns -> str programs that aren't installed + """ + if dependencies is None: + return "" + + not_installed = [] + + for program in dependencies: + if which(program) is not None: + continue + + not_installed.append(program) + + first_row = "The following software is not installed, some scripts may not work\n" + + if not_installed: + return first_row + "\n".join(not_installed) + else: + return "" + +def main(): + + print_program_welcome() + + if not get_correct_os(): + raise OSError("Sorry Qtile is only supported in Linux") + + if not check_local_folder_exists(): + print("\n.local/bin folder doesn't exists\n") + + response = get_response(message="Do you want to create that directory [yes, no] >> ") + + if not response: + print("Setup can't continue if .local/bin doesn't exists") + print("Rerun the script or set up the scripts manually") + exit() + + print("Creating .local/bin/folder") + create_local_install_folder(LOCAL_BIN) + + + dependencies = get_dependencies() + scripts_path = "./scripts" + print(check_dependencies(dependencies=dependencies)) + print(link_scripts(path=scripts_path)) + + +if __name__ == "__main__": + main() + \ No newline at end of file diff --git a/modules/wm/qtile/config/software.txt b/modules/wm/qtile/config/software.txt new file mode 100644 index 0000000..3a49b82 --- /dev/null +++ b/modules/wm/qtile/config/software.txt @@ -0,0 +1,11 @@ +picom +nitrogen +megasync +xfce4-clipman-plugin +playerctl +pulseaudio-ctl +bat +python-psutil +alacritty +brave-browser +lxappearance-gtk3 \ No newline at end of file diff --git a/modules/wm/qtile/config/widgets.py b/modules/wm/qtile/config/widgets.py new file mode 100644 index 0000000..9f9063b --- /dev/null +++ b/modules/wm/qtile/config/widgets.py @@ -0,0 +1,456 @@ +import os +from libqtile import bar, widget +from libqtile.lazy import lazy +from libqtile.config import Screen + +from functions import PWA +# widget_defaults = dict( +# font="Ubuntu Mono", +# fontsize = 12, +# padding = 2, +# background=colors[2] +# ) + +# extension_defaults = widget_defaults.copy() + + +class MyWidgets: + def __init__(self): + self.colors = [["#292d3e", "#292d3e"], # panel background + # background for current screen tab + ["#434758", "#434758"], + ["#ffffff", "#ffffff"], # font color for group names + # border line color for current tab + ["#bc13fe", "#bc13fe"], # Group down color + # border line color for other tab and odd widgets + ["#8d62a9", "#8d62a9"], + ["#668bd7", "#668bd7"], # color for the even widgets + ["#e1acff", "#e1acff"], # window name + + ["#000000", "#000000"], + ["#AD343E", "#AD343E"], + ["#f76e5c", "#f76e5c"], + ["#F39C12", "#F39C12"], + ["#F7DC6F", "#F7DC6F"], + ["#f1ffff", "#f1ffff"], + ["#4c566a", "#4c566a"], ] + + self.termite = "alacritty" + + def init_widgets_list(self): + ''' + Function that returns the desired widgets in form of list + ''' + widgets_list = [ + widget.Sep( + linewidth=0, + padding=5, + foreground=self.colors[2], + background=self.colors[0] + ), + widget.GroupBox( + font="Ubuntu Bold", + fontsize=12, + margin_y=2, + margin_x=0, + padding_y=5, + padding_x=3, + borderwidth=3, + active=self.colors[-2], + inactive=self.colors[-1], + # rounded=True, + rounded=False, + # highlight_color=self.colors[9], + # highlight_method="line", + highlight_method='block', + urgent_alert_method='block', + # urgent_border=self.colors[9], + this_current_screen_border=self.colors[9], + this_screen_border=self.colors[4], + other_current_screen_border=self.colors[0], + other_screen_border=self.colors[0], + foreground=self.colors[2], + background=self.colors[0], + disable_drag=True + ), + # widget.Prompt( + # prompt=lazy.spawncmd(), + # font="Ubuntu Mono", + # padding=10, + # foreground=self.colors[3], + # background=self.colors[1] + # ), + widget.Sep( + linewidth=0, + padding=25, + foreground=self.colors[2], + background=self.colors[0] + ), + widget.WindowName( + foreground=self.colors[6], + background=self.colors[0], + padding=5 + ), + widget.Systray( + background=self.colors[0], + padding=5 + ), + # widget.TextBox( + # font="Ubuntu Bold", + # text='', + # background=self.colors[0], + # foreground=self.colors[11], + # padding=0, + # fontsize=37 + # ), + widget.Battery( + charge_char='+', discharge_char='-', error_message='error', + format='{percent:2.0%} ({char}{hour:d}:{min:02d})', hide_threshold=None, + low_percentage=0.1, foreground=self.colors[7], background=self.colors[10], update_delay=10), + widget.TextBox( + text=" 🖬", + foreground=self.colors[7], + background=self.colors[11], + padding=0, + fontsize=14 + ), + widget.Memory( + foreground=self.colors[7], + background=self.colors[11], + mouse_callbacks={'Button1': lambda: qtile.cmd_spawn( + self.termite + ' -e htop')}, + padding=5 + ), + widget.ThermalSensor( + # interface="enp5s0", + # fmt='Net: {down} ↓↑ {up}', + foreground=self.colors[7], + background=self.colors[9], + padding=5 + ), + # widget.TextBox( + # text='', + # background=self.colors[11], + # foreground=self.colors[10], + # padding=0, + # fontsize=37 + # ), + widget.TextBox( + text="  ", + foreground=self.colors[7], + background=self.colors[10], + padding=0, + mouse_callbacks={ + "Button1": lambda: qtile.cmd_spawn("pavucontrol")} + ), + widget.Volume( + foreground=self.colors[7], + background=self.colors[10], + padding=5 + ), + # widget.TextBox( + # text='', + # background=self.colors[10], + # foreground=self.colors[9], + # padding=0, + # fontsize=37 + # ), + widget.CurrentLayoutIcon( + custom_icon_paths=[os.path.expanduser( + "~/.config/qtile/icons")], + foreground=self.colors[0], + background=self.colors[9], + padding=0, + scale=0.7 + ), + widget.CurrentLayout( + foreground=self.colors[7], + background=self.colors[9], + padding=5 + ), + # widget.TextBox( + # text='', + # foreground=self.colors[8], + # background=self.colors[9], + # padding=0, + # fontsize=37 + # ), + widget.Clock( + foreground=self.colors[7], + background=self.colors[8], + mouse_callbacks={ + "Button1": lambda qtile: qtile.cmd_spawn(PWA.calendar())}, + format="%A %d - %H:%M" + ), + widget.Sep( + linewidth=0, + padding=10, + foreground=self.colors[0], + background=self.colors[8] + ), + ] + return widgets_list + + def init_widgets_screen(self): + ''' + Function that returns the widgets in a list. + It can be modified so it is useful if you have a multimonitor system + ''' + widgets_screen = self.init_widgets_list() + return widgets_screen + + def init_widgets_screen2(self): + ''' + Function that returns the widgets in a list. + It can be modified so it is useful if you have a multimonitor system + ''' + widgets_screen2 = self.init_widgets_screen() + return widgets_screen2 + + def init_screen(self): + ''' + Init the widgets in the screen + ''' + return [Screen(top=bar.Bar(widgets=self.init_widgets_screen(), opacity=1.0, size=20)), + Screen(top=bar.Bar( + widgets=self.init_widgets_screen2(), opacity=1.0, size=20)) + ] + + +# bar = Bar([ +# Sep( +# linewidth = 0, +# padding = 2, +# foreground = onedark_darker["color4"], +# background = onedark_darker["color4"] +# ), +# Image( +# filename = "~/.config/qtile/icons/archlinux_blue.png", +# scale = "False", +# mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn("alacritty")}, +# background = onedark_darker["color4"], +# ), +# #widget.Sep( +# # linewidth = 0, +# # padding = 2, +# # foreground = onedark_darker["colorback"], +# # background = onedark_darker["colorback"] +# #), +# right_arrow(onedark_darker["color4"], onedark_darker["colorback"]), +# GroupBox( +# font = "JetBrains Nerd Font Mono Bold", +# fontsize = 12, +# fmt = '{}', +# borderwidth = 2, +# background = onedark_darker["colorback"], +# active = onedark_darker["color6"], +# inactive = onedark_darker["color5"], +# rounded = False, +# #Block_highlight_text_color = onedark_darker["color3"], +# highlight_method = 'line', +# highlight_color = onedark_darker["colorback"], # line block colour +# this_current_screen_border = onedark_darker["color4"], +# this_screen_border = onedark_darker["color7"], +# urgent_alert_method = 'line', +# urgent_border = onedark_darker["color10"], +# urgent_text = onedark_darker["color14"], +# disable_drag = True, +# ), +# right_arrow(onedark_darker["colorback"], onedark_darker["color14"]), +# CurrentLayoutIcon( +# custom_icon_paths = [os.path.expanduser("~/.config/qtile/icons")], +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color14"], +# padding = 0, +# scale = 0.7 +# ), +# CurrentLayout( +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color14"], +# padding = 5, +# ), +# right_arrow(onedark_darker["color14"], onedark_darker["color9"]), +# TextBox( +# text = '', +# font = "Font Awesome 6 Free Solid", +# fontsize = 15, +# background = onedark_darker["color9"], +# foreground = onedark_darker["color4"], +# padding = 2 +# ), +# WindowCount( +# format = ' {num} ', +# background = onedark_darker["color9"], +# foreground = onedark_darker["color4"], +# show_zero = True, +# ), +# right_arrow(onedark_darker["color9"], onedark_darker["color1"]), +# WindowName( +# foreground = onedark_darker["color5"], +# background = onedark_darker["color1"], +# padding = 5, +# format = '[ {name} ]', +# empty_group_string = '[ ]', +# parse_text = parse_func, +# ), +# #widget.Spacer(), +# Sep( +# linewidth = 0, +# padding = 6, +# foreground = onedark_darker["color1"], +# background = onedark_darker["color1"], +# ), +# left_arrow(onedark_darker["color2"], onedark_darker["color1"]), +# TextBox( +# text = '', +# font = "Font Awesome 6 Free Solid", +# fontsize = 15, +# padding = 2, +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color2"], +# ), +# Net( +# interface = "wlp44s0", +# format = '{down} {up}', +# prefix = 'M', +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color2"], +# padding = 5, +# ), +# left_arrow(onedark_darker["color3"], onedark_darker["color2"]), +# TextBox( +# text = '', +# font = "Font Awesome 6 Free Solid", +# fontsize = 15, +# padding = 2, +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color3"] +# ), +# CPU( +# background = onedark_darker["color3"], +# foreground = onedark_darker["colorback"], +# fmt = 'Cpu: {}', +# #format = '{freq_current}GHz {load_percent}%', +# format = '[ {load_percent} ]%', +# padding = 5, +# ), +# left_arrow(onedark_darker["color4"], onedark_darker["color3"]), +# TextBox( +# text = '', +# font = "Font Awesome 6 Free Solid", +# fontsize = 15, +# padding = 2, +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color4"] +# ), +# ThermalSensor( +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color4"], +# threshold = 90, +# fmt = 'Temp: {}', +# format='[ {temp:.0f}{unit} ]', +# padding = 5, +# ), +# left_arrow(onedark_darker["color5"], onedark_darker["color4"]), +# TextBox( +# text = '', +# font = "Font Awesome 6 Free Solid", +# fontsize = 15, +# padding = 2, +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color5"] +# ), +# Memory( +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color5"], +# #mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e htop')}, +# fmt = 'Mem: {}', +# #format = '{MemUsed: .0f}{mm}/{MemTotal: .0f}{mm}', +# format = '[ {MemUsed:.0f} ]{mm}', +# padding = 5, +# ), +# left_arrow(onedark_darker["color6"], onedark_darker["color5"]), +# TextBox( +# text = '', +# font = "Font Awesome 6 Free Solid", +# fontsize = 15, +# padding = 2, +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color6"] +# ), +# Battery( +# padding = 5, +# background = onedark_darker["color6"], +# foreground = onedark_darker["colorback"], +# charge_char = 'AC', +# discharge_char = '', +# empty_char = 'ﮣ', +# full_char = 'ﭹ', +# fmt = 'Bat: {}', +# format = '{char}[ {percent:2.0%} ]', #{hour:d}:{min:02d} {watt:.2f} W' +# #low_background = none, +# low_forground = '#ff0000', +# update_interval = 60, +# ), +# #battery, + +# left_arrow(onedark_darker["color7"], onedark_darker["color6"]), +# TextBox( +# text = '', +# font = "Font Awesome 6 Free Solid", +# fontsize = 15, +# padding = 2, +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color7"] +# ), +# PulseVolume( +# background = onedark_darker["color7"], +# foreground = onedark_darker["colorback"], +# fmt = 'Vol: [ {} ]', +# device = 'default', +# channel = 'Master', +# limit_max_volume = True, +# padding = 5, +# update_interval = 0.1, +# mute_command = 'pactl set-sink-mute @DEFAULT_SINK@ toggle', +# volume_up_command = 'pactl set-sink-volume @DEFAULT_SINK@ +5%', +# volume_down_command = 'pactl set-sink-volume @DEFAULT_SINK@ -5%', +# ), +# #volume, +# #widget.Volume( +# # foreground = onedark_darker[8], +# # background = onedark_darker[0], +# # fmt = 'Vol: {}', +# # padding = 5, +# # mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e alsamixer')} +# #), +# left_arrow(onedark_darker["color10"], onedark_darker["color7"]), +# TextBox( +# text = '', +# font = "Font Awesome 6 Free Solid", +# fontsize = 15, +# padding = 2, +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color10"] +# ), +# Clock( +# foreground = onedark_darker["colorback"], +# background = onedark_darker["color10"], +# format = "%a %d, %b [ %I:%M ]%P", +# padding = 5, +# ), +# left_arrow(onedark_darker["colorback"], onedark_darker["color10"]), +# Systray( +# background = onedark_darker["colorback"], +# padding = 2 +# ), + +# #widget.TextBox( +# # text = '', +# # font = "Mononoki Regular Bold", +# # fontsize = 18, +# # padding = 0, +# # background = onedark_darker[0], +# # foreground = onedark_darker[9], +# #), +# ], size=25) diff --git a/modules/wm/qtile/default.nix b/modules/wm/qtile/default.nix new file mode 100644 index 0000000..f1ccf51 --- /dev/null +++ b/modules/wm/qtile/default.nix @@ -0,0 +1,31 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + cfg = config.horseman.wm.qtile; +in { + options = { + horseman.desktop.qtile = { + enable = mkEnableOption "Qtile"; + }; + }; + + config = { + services.xserver = { + enable = true; + windowManager.qtile.enable = true; + }; + + system.activationScripts.script.text = '' + cd /home/horseman && \ + rm -r .config/qtile && \ + cp -r nix-config/modules/wm/qtile/config \ + .config/qtile + ''; + }; +} diff --git a/overhaul/machines/common/configuration.nix b/overhaul/machines/common/configuration.nix deleted file mode 100644 index 65d3b93..0000000 --- a/overhaul/machines/common/configuration.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - imports = [ - ../../pkgs/zsh.nix - ]; - - services.tailscale.enable = true; - - services.mullvad-vpn.enable = true; - services.mullvad-vpn.package = pkgs.mullvad-vpn; - networking.nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ]; - services.resolved = { - enable = true; - dnssec = "true"; - domains = [ "~." ]; - fallbackDns = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ]; - }; - - sops = { - defaultSopsFile = ../../secrets/secrets.yaml; - defaultSopsFormat = "yaml"; - age = { - sshKeyPaths = [ "/home/horseman/.ssh/id_ed25519" ]; - keyFile = "/home/horseman/.config/sops/age/keys.txt"; - generateKey = false; - }; - secrets = { - "syncthing/user".owner = "horseman"; - "syncthing/password".owner = "horseman"; - }; - templates = { - "syncuser".content = ''${config.sops.placeholder."syncthing/user"}''; - "syncpassword".content = ''${config.sops.placeholder."syncthing/password"}''; - }; - }; - - services.syncthing = { - enable = true; - user = "horseman"; - dataDir = "/home/horseman"; - configDir = "/home/horseman/.config/syncthing"; - overrideDevices = true; - overrideFolders = true; - settings = { - options = { - urAccepted = -1; - }; - gui = { - user = config.sops.templates."syncuser".content; - password = config.sops.templates."syncpassword".content; - }; - devices = { - "luna" = { - id = "MW4ZTAX-D7KDLRL-YHNGNCF-V6FW5L4-SCKQKES-BO7KV43-L5667GL-JHIYEAA"; - autoAcceptFolders = true; - name = "luna"; - }; - "terra" = { - id = "2QWRFLY-ZUY5C6C-X36R5CY-PJSGLYY-5HWIWJN-2YYWRPU-T66GJMU-GXTQ6QK"; - autoAcceptFolders = true; - name = "terra"; - }; - "solis" = { - id = "YOSYADZ-3OZ3XBH-7XEIK2W-DHAEIFD-5P5ZIHB-PAP74DH-T7GHLKT-O32YEA4"; - autoAcceptFolders = true; - name = "solis"; - }; - }; - folders = { - "Documents" = { - id = "documentFolder"; - path = "/home/horseman/Documents"; - devices = [ "luna" "terra" "solis" ]; - }; - }; - }; - }; - networking.firewall.allowedUDPPorts = [ 22000 21027 ]; - networking.firewall.allowedTCPPorts = [ 8384 22000 ]; -} diff --git a/overhaul/machines/luna/configuration.nix b/overhaul/machines/luna/configuration.nix deleted file mode 100644 index 1bb7542..0000000 --- a/overhaul/machines/luna/configuration.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ./hardware-configuration.nix - ../../pkgs/firefox.nix - ../common/configuration.nix - ]; - - home-manager = { - extraSpecialArgs = { inherit inputs outputs; }; - users = { - horseman = import ../../home-manager/apps.nix; - }; - }; - - networking.hostName = "luna"; - networking.networkmanager.enable = true; - networking.extraHosts = '' - 127.0.0.1 koala.rails.local members.rails.local leden.rails.local intro.rails.local - ''; - - services.xserver.enable = true; - services.desktopManager.plasma6.enable = true; - services.displayManager.sddm.enable = true; - services.displayManager.sddm.autoNumlock = true; - services.displayManager.defaultSession = "plasma"; - - hardware.bluetooth.enable = true; - hardware.pulseaudio.enable = false; - services.jack = { - jackd.enable = false; - alsa.enable = true; - loopback.enable = false; - }; - - environment.plasma6.excludePackages = with pkgs.kdePackages; [ - kate - konsole - ]; - environment.gnome.excludePackages = with pkgs; [ - gnome-calendar - gnome-characters - nautilus - gnome-clocks - gnome-contacts - evince - file-roller - geary - gnome-system-monitor - eog - gnome-logs - gnome-maps - gnome-music - seahorse - gnome-text-editor - ]; - - - virtualisation.docker.enable = true; - - virtualisation.virtualbox.host.enable = true; - users.extraGroups.vboxusers.members = [ "horseman" ]; - - users.extraUsers.horseman.extraGroups = [ "jackaudio" ]; -} diff --git a/overhaul/machines/luna/hardware-configuration.nix b/overhaul/machines/luna/hardware-configuration.nix deleted file mode 100644 index d3d28bb..0000000 --- a/overhaul/machines/luna/hardware-configuration.nix +++ /dev/null @@ -1,38 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/c1447573-eee5-48ea-9937-84330065628b"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/B516-99F1"; - fsType = "vfat"; - }; - - swapDevices = [ ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/overhaul/machines/solis/configuration.nix b/overhaul/machines/solis/configuration.nix deleted file mode 100644 index 3607241..0000000 --- a/overhaul/machines/solis/configuration.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ./hardware-configuration.nix - ../common/configuration.nix - ../../modules/sleep-at-night.nix - ]; - - home-manager = { - extraSpecialArgs = { inherit inputs outputs; }; - users = { - horseman = import ../../home-manager/server-apps.nix; - }; - }; - - networking.hostName = "solis"; - - virtualisation.docker.enable = true; - - services.resolved.enable = true; - services.resolved.extraConfig = "DNSStubListener=no\n"; - - systemd.timers."backupSyncthing" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "weekly"; - Persistent = true; - }; - }; - - systemd.services."backupSyncthing" = { - script = '' - /home/horseman/nix-config/misc/backup.sh - ''; - serviceConfig = { - Type = "oneshot"; - User = "horseman"; - }; - }; - - # services.sleep-at-night = { - # enable = true; - # shutdown = { - # hour = 00; - # minute = 30; - # }; - # wakeup = "08:00:00"; - # }; - - networking.firewall.enable = true; - networking.firewall.allowPing = true; -} diff --git a/overhaul/machines/solis/hardware-configuration.nix b/overhaul/machines/solis/hardware-configuration.nix deleted file mode 100644 index 02593b1..0000000 --- a/overhaul/machines/solis/hardware-configuration.nix +++ /dev/null @@ -1,34 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "ahci" "ohci_pci" "ehci_pci" "pata_atiixp" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/74211087-d087-49d5-bc58-eb49748a51f0"; - fsType = "ext4"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/bfe8c490-e8d7-438e-b95b-5bc5743bb23b"; } - ]; - - # 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/overhaul/machines/terra/configuration.nix b/overhaul/machines/terra/configuration.nix deleted file mode 100644 index 0e90857..0000000 --- a/overhaul/machines/terra/configuration.nix +++ /dev/null @@ -1,109 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ./hardware-configuration.nix - ./refind.nix - ../../pkgs/firefox.nix - ../common/configuration.nix - ]; - - # NVIDIA Drivers - hardware.graphics.enable32Bit = true; - hardware.graphics.enable = true; - services.xserver.videoDrivers = ["nvidia"]; - hardware.nvidia = { - modesetting.enable = true; - powerManagement.enable = false; - powerManagement.finegrained = false; - open = true; - nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.stable; - }; - # End NVIDIA - - - home-manager = { - extraSpecialArgs = { inherit inputs outputs; }; - users = { - horseman = import ../../home-manager/apps.nix; - }; - }; - - networking.hostName = "terra"; - - systemd.timers."enable-wol" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnBootSec = "5m"; - OnUnitActiveSec = "1m"; - Unit = "enable-wol.service"; - }; - }; - - systemd.services."enable-wol" = { - script = '' - /home/horseman/nix-config/misc/startup.sh - ''; - serviceConfig = { - Type = "oneshot"; - User = "root"; - }; - }; - - environment.systemPackages = with pkgs; [ - ethtool - ]; - - environment.plasma6.excludePackages = with pkgs.kdePackages; [ - kate - konsole - ]; - environment.gnome.excludePackages = with pkgs; [ - gnome-calendar - gnome-characters - nautilus - gnome-clocks - gnome-contacts - evince - file-roller - geary - gnome-system-monitor - eog - gnome-logs - gnome-maps - gnome-music - seahorse - gnome-text-editor - ]; - - services.xserver.enable = true; - services.desktopManager.plasma6.enable = true; - services.xserver.desktopManager.gnome.enable = true; - services.displayManager.sddm.enable = true; - services.displayManager.sddm.autoNumlock = true; - services.displayManager.sddm.wayland.enable = false; - services.displayManager.defaultSession = "plasma"; - boot.loader.systemd-boot.enable = true; - - programs.ssh.askPassword = lib.mkForce "/nix/store/qrzq7dqp8dkffb5dvi42q647dhm87ady-ksshaskpass-6.0.3/bin/ksshaskpass"; - - networking.networkmanager.enable = true; - - virtualisation.docker.enable = true; - - hardware.pulseaudio.enable = false; - services.jack = { - jackd.enable = true; - alsa.enable = false; - loopback.enable = true; - }; - - users.extraUsers.horseman.extraGroups = [ "jackaudio" ]; -} diff --git a/overhaul/machines/terra/hardware-configuration.nix b/overhaul/machines/terra/hardware-configuration.nix deleted file mode 100644 index 509f196..0000000 --- a/overhaul/machines/terra/hardware-configuration.nix +++ /dev/null @@ -1,39 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/4d963cda-4ec7-4cee-8e82-35402d385f54"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6AB6-63FD"; - fsType = "vfat"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/53db744d-a858-49b0-a3a1-c7c576aba0c9"; } - ]; - - # 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/overhaul/modules/boot/grub.nix b/overhaul/modules/boot/grub.nix deleted file mode 100644 index 0921d5c..0000000 --- a/overhaul/modules/boot/grub.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: let - inherit (lib) mkEnableOption mkIf mkOption types; - cfg = config.horseman.boot.grub; -in { - options = { - horseman.boot.grub = { - enable = mkEnableOption "Enables grub, the bootloader"; - }; - }; - - config = mkIf cfg.enable { - boot.loader.grub = { - enable = true; - device = "/dev/sda"; - configurationLimit = 10; - }; - }; -} diff --git a/overhaul/modules/boot/systemd.nix b/overhaul/modules/boot/systemd.nix deleted file mode 100644 index 576852b..0000000 --- a/overhaul/modules/boot/systemd.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: let - inherit (lib) mkEnableOption mkIf mkOption types; - cfg = config.horseman.boot.systemd; -in { - options = { - horseman.boot.systemd = { - enable = mkEnableOption "Enables systemd, the bootloader"; - }; - }; - - config = mkIf cfg.enable { - boot.kernelModules = [ "snd-seq" "snd-rawmidi" ]; - boot.loader.systemd-boot = { - enable = true; - configurationLimit = 10; - }; - }; -} diff --git a/overhaul/modules/packages/console.nix b/overhaul/modules/packages/console.nix deleted file mode 100644 index 37ccda7..0000000 --- a/overhaul/modules/packages/console.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: let - inherit (lib) mkEnableOption mkIf mkOption types; - cfg = config.horseman.terminal.pkgs; -in { - options = { - horseman.terminal.pkgs = { - enable = mkEnableOption "Packages that are used in the terminal"; - }; - }; - - config = mkIf cfg.enable { - environment.packages = with pkgs; [ - direnv - docker-compose - efibootmgr - ethtool - file - fzf - gcc - gnupg - haskell.compiler.native-bignum.ghcHEAD - haskell-language-server - htop - jdk - neofetch - nodejs_22 - python313 - platformio-core - sops - sqlite - sxiv - termdown - tmux - unzip - wakeonlan - zsh - xclip - ]; - }; -} diff --git a/overhaul/modules/packages/visual.nix b/overhaul/modules/packages/visual.nix deleted file mode 100644 index 2d197bc..0000000 --- a/overhaul/modules/packages/visual.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: let - inherit (lib) mkEnableOption mkIf mkOption types; - cfg = config.horseman.packages.visual; -in { - options = { - horseman.packages.visual = { - enable = mkEnableOption "Programs that open in a window on the screen"; - }; - }; - - config = mkIf cfg.enable { - environment.packages = with pkgs; [ - alacritty - bitwarden - discord-ptb - ghex - gnome-calculator # Should be replaced, opens up so slowww - jetbrains.clion - jetbrains.idea-ultimate - jetbrains.pycharm-professional - jetbrains.rider - jetbrains.webstorm - inkscape - keepassxc - krita - libreoffice - mullvad-vpn - parsec-bin - qbittorrent - reaper - retext - solaar - spotify - sqlitebrowser - thunderbird - vlc - ]; - }; -} diff --git a/overhaul/modules/terminal/neovim.nix b/overhaul/modules/terminal/neovim.nix deleted file mode 100644 index fe79364..0000000 --- a/overhaul/modules/terminal/neovim.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: let - inherit (lib) mkEnableOption mkIf mkOption types; - cfg = config.horseman.terminal.neovim; -in { - options = { - horseman.terminal.neovim = { - enable = mkEnableOption "Neovim options"; - }; - }; - - config = mkIf cfg.enable { - - }; -} diff --git a/overhaul/modules/users/horseman.nix b/overhaul/modules/users/horseman.nix deleted file mode 100644 index b61e16a..0000000 --- a/overhaul/modules/users/horseman.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: -let - inherit (lib) mkEnableOption mkIf mkOption types; - cfg = config.horseman.users.horseman; -in -{ - options = { - horseman.users.horseman = { - enable = mkEnableOption "User 'horseman'"; - }; - }; - - config = mkIf cfg.enable { - users.users = { - horseman = { - initialPassword = "correct horse battery staple"; - isNormalUser = true; - openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCtbmZFvOsukUtqKnRkzLqphpgA0HF/mCcH/6BtPah6G4v6gqu8za58w8/0//aGkurG3sfQ5YhphFMJYm26/QdCUvVYeC92LWC5mjWB/md+BOWCoZYoEL0NHuu5f+7EQcmxLYuIv7mzHB1T+fwgOyuoW6IKLLQcmokx4uyg8apUs0yaRr9rCmoxeYOlZlsE6pKS2E8YUEkCRUZ1PZW6ILHXOOaz3KQ7s429MPvKv+061SlyEZuyinzsS1+4e/j5fCddq9Ac2ar1TiIkFhmtpJfJ2iWzVAvpZ08KV4nHgews07jjuj0/dZufSXbWJI6fQCMRvETeQsDU0RB6AxO//6plSo6svsGa/XhZx55AZAotflc2EzIi5QPWa078xu8IR23/flj52gqCj3O7RxhZib+L4cCdAS8nSZkLw9VV2kROqf4JcRYsinfKetBBPJU3RYKDVq8uF23eliNw+5lYKJu5FzPVFmS/J+vAme/vHkHLNKz5CnZoABjeue4PEnpSyFCJhf4w94lbB9JBaxKuZoXvaPE7bKDTHWbVC9DKWrL+QqNP5tsiV3/jI9gx4ty9OihMv5p46ennD17AbMM6xi/yPjvX6jbDIo+jMswW1ndhH2Ka6PTRpx8G+BWgoEVjCoP/DptloE6B5EfZous8Yd+RBuRiqNk4WUB+6PWVO7ELfQ horseman" # luna - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCmYI+jn1B69r4GUEeVE1/q+HSNcLzT+qG0nEpIjyO3VCsocLIJqT6cJtPKTh/j9RPySvz1lo2ZFemCeKBfsdHy95JoYqbAcoJ9jacH3X8LixIiGin6ew/h6QJONU1UAuxcEDoEyeHfmNBRdgaahNTWtgvFd1YhB4WQwN9THZ/axGdnWLi/y0y98aqERw98fGOhAzxqZyeGkWK5ByRiiGmfrmU7IsX916z5s9OPFYeIGvI3UPKL5awpQMrD/+VhtQjAy8guWbBKbN+7cVU/JQjhaPAeVC18iON++Ux6pGq1/yA+IFDb/fFofXD70vRYemg7zSVbf2ceBg8iSR2OdcZVPfhIKq7mx62TcYVY7aDlz7fFedl7tVhxRd5Ze7T/kbRQtbqL++3UQaZwnx6HoXGMvdIbKV/KHcmqjQQClzWZyk8oI+VbkF/nfTgShW/X0UQYzBSdsCb4XywzfnLRH4Ops/v7ZOc2zBApl7j1Oj+nW7dJ5/P6FgMw553tNXnEVXqGvdvalmDl/hjR3UVedm18ZKwu+6+1mcHsDGKCi5C79zVksr9IbFNICosA23xfrnKQYmncBzobbY4N39SToI9ulcukOJj26ooAG3RhHqSyOkcM3nTUbHwKb/19J+NAm2iT9ipNGurwwPO4VcJY36237es7MEkmQHfD1ZOo6biafw horseman" # terra - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCrgH3kBWwxoFms9ggilPmiKX9X0/AlWjGN7a+k3ddwfK0LvH9T8ueil1Zjw16P0XNMmy076bUBJJ89aVILXgYx+ngKmnIg32lqo5bafEpub1c3wtjGcwXtJnUXMwcqdIjkR2sfzuQPLXlob/Q+GsShm4TBEtzVTdpbCj768LyTtFx4vHZByyGtam0Ibb/6GVE1V2IcA/R+iQlCAqSjFxvSq1ll+wxsEUaT7b0ru1WhUXz0ITWoRkA8p0UjTl/uoXYcsPsqGR7dXgW7hNF087TOf+FsmiL+I6pbbB8+at5yq8I6l1lCwfLaMz2M5lHkn5jZiBuUDOXWpbbk1214iWrymAbpbVmNU68QVEcQkJTnfbRQ/56Nvq80emFgke6p4vcVnR9iVbaZDnOkMVH6HEs0Qc/rC38p9aISAdJvI49GWaz8fs1OgVi7mj9xA0QREc6/oalJ1F3BehPUk8v4uqww3u+I2AdWPp/6HO9zVU2mTrO30a8IbjOqFqMqdV+nYFxNbHIIIZ9acv95FGqIBCG0U9d8XVVFQ+kVWxkXxPk0uynzAsrXyiH3gzxHwy7stCxybZkTpQPjf+vSt4Tz3PRxnyq1OWTUzWmBVe0MCdZX5h/oQp6kI1Ys/t+UrP1G9NEIwGg+/zlpmGiV8Pm10b6gEXgv09BQPFGPsBbl4NRpQQ horseman" # solis - ]; - extraGroups = [ - "wheel" - "networkmanager" - "docker" - ]; - }; - }; - - services.openssh = { - enable = true; - settings = { - PermitRootLogin = "no"; - PasswordAuthentication = false; - }; - }; - - # lmao idk if I should remove this but it's funny so imma keep it - system.stateVersion = "23.11"; - }; -} diff --git a/overhaul/secrets/secrets.yaml b/overhaul/secrets/secrets.yaml deleted file mode 100644 index e738999..0000000 --- a/overhaul/secrets/secrets.yaml +++ /dev/null @@ -1,23 +0,0 @@ -syncthing: - user: ENC[AES256_GCM,data:DfJyEnHAC74qvy8=,iv:q5A1to6eoBkXF6uRo+OWhVoP5WnkBnEVVd66tWAI7Sc=,tag:hK3OtNXX66BT8hpxtY1a0w==,type:str] - password: ENC[AES256_GCM,data:5So/Ay3zszQl58d1ub9PmTPs0wwERa28X0Osh0qSwjaHqOewxQ==,iv:zcRrxgcO+vGnVzuXMY8BXYrc+xFHh3/RZXvC7FBKLcY=,tag:GbPqK447lfS4ME3FXTVZaA==,type:str] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age167thunwadsswd0u37tajk85wy4x7sgw6sg3j2aspcax7essmge6qwen0uz - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA2S3hLRWQrSHBQdjNhbDV2 - VmwrbUVsc0IwaDZKUndOTEMxN0kwWUtaYzJrCjJtNUdBMkhDVDB0akg2TTlqS1lF - NWJESlorR28rUGZHeEh6dFJYcEFsQnMKLS0tIFY3b0ZDSzM3SGVCZW9xcnJLc296 - ckJwQ3EzU2JzdGhnWkNnRExRNlprM28KUHkZe8FvLOAt+UVqvgOxBQdApbEXQ44v - vXW8UtZuq7GjsP5qD2MK6oKs/ZDfe+PhqiWl4ONNHvpn8rmfbQDcRw== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-10-08T16:55:41Z" - mac: ENC[AES256_GCM,data:VSOGYnpkU9gD/7JaCdIC84XHI5rHc4PhqSB64YvPehTrA4rgRGynMxSfvb+zRt+rIO8Qyhnt+i9zjsOLa9Z1F8xOx6f23oLRtguvYBNWJIhYaUvmS7lqPryvJGv3aoVvWkRAoSHyizIqXfmHvn0z/QfEst9PS72I4xf1pQu3trs=,iv:GJzYvWn1EOJ++QYW9jYrUfLAwTceAKFD078JWukMhH0=,tag:q62MpyvDneSYXSzu8S3qUQ==,type:str] - pgp: [] - unencrypted_suffix: _unencrypted - version: 3.9.1 diff --git a/pkgs/default.nix b/pkgs/default.nix deleted file mode 100644 index 3d9e23c..0000000 --- a/pkgs/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -# Custom packages, that can be defined similarly to ones from nixpkgs -# You can build them using 'nix build .#example' -pkgs: { - # example = pkgs.callPackage ./example { }; -} diff --git a/pkgs/firefox.nix b/pkgs/firefox.nix deleted file mode 100644 index 0b5c8ef..0000000 --- a/pkgs/firefox.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - config, - pkgs, - ... -}: { - programs.firefox = { - enable = true; - policies = { - Preferences.general.autoScroll = true; - ExtensionSettings = { - "*".installation_mode = "blocked"; - # uBlock Origin: - "uBlock0@raymondhill.net" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; - installation_mode = "force_installed"; - }; - # Bitwarden - "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; - installation_mode = "force_installed"; - }; - # Dark Reader - "addon@darkreader.org" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi"; - installation_mode = "force_installed"; - }; - # Advent of Code delta-rank - "{78b07db2-25ed-4088-9c92-5c5dcfca3c3c}" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/advent-of-code-delta-score/latest.xpi"; - installation_mode = "force_installed"; - }; - # SponsorBlock - "{sponsorBlocker@ajay.app}" = { - install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/sponsorblock/latest.xpi"; - installation_mode = "force_installed"; - }; - }; - }; - }; -} diff --git a/pkgs/zsh.nix b/pkgs/zsh.nix deleted file mode 100644 index 363ea8d..0000000 --- a/pkgs/zsh.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - config, - pkgs, - ... -}: { - users.defaultUserShell = pkgs.zsh; - environment.shells = with pkgs; [ zsh ]; - - programs.zsh = { - enable = true; - enableCompletion = true; - - histSize = 10000; - - shellAliases = { - clone-dotfiles = "cp /home/horseman/nix-config/config/dotfiles/.\* /home/horseman/"; - rebuild = "clone-dotfiles && sudo nixos-rebuild switch --flake"; - update = "sudo nix flake update && rebuild"; - compose = "sudo docker compose"; - wolpc = "wakeonlan D8:5E:D3:A8:B1:0A"; - capture-config = "nix run github:pjones/plasma-manager > ~/nix-config/home-manager/plasma.nix"; - reboot-to-windows = "sudo efibootmgr -n 0000"; - mkdir = "mkdir -p"; - }; - - ohMyZsh = { - enable = true; - plugins = [ - "git" - "zsh-interactive-cd" - "python" - "git-auto-fetch" - "wd" - ]; - custom = "/home/horseman/nix-config/pkgs/zsh/"; - theme = "jonathan"; - }; - - shellInit = "eval \"$(direnv hook zsh)\""; - }; -} diff --git a/pkgs/zsh/plugins/nix-shell/LICENSE b/pkgs/zsh/plugins/nix-shell/LICENSE deleted file mode 100644 index 8ef4734..0000000 --- a/pkgs/zsh/plugins/nix-shell/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2018, Philipp Dargel -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Spencer Whitt nor the names of other - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pkgs/zsh/plugins/nix-shell/README.MD b/pkgs/zsh/plugins/nix-shell/README.MD deleted file mode 100644 index ca2c790..0000000 --- a/pkgs/zsh/plugins/nix-shell/README.MD +++ /dev/null @@ -1,113 +0,0 @@ - -# zsh in nix-shell - -This [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh/) plugin lets you use zsh as the default shell in a `nix-shell` environment. It's recommended to use this in conjunction with [nix-zsh-completions](https://github.com/spwhitt/nix-zsh-completions). - -# Motivation - -In theory all you need to do to use `zsh` in `nix-shell` is to set `NIX_BUILD_SHELL` to `zsh`. Unfortunatly nix assumes that the `NIX_BUILD_SHELL` is a bash variant and passes bash specific arguments to the shell. To fix this, we need a shim that translates these arguments. - -The information that `nix-shell` exposes to the environment is also pretty sparse. It would be nice to know what derivations are included in the current environment for example to display them in the shells prompt. - -# Installation - -## Oh-My-ZSH - -Clone this repository into your plugins directory - -```sh -git clone https://github.com/chisui/zsh-nix-shell.git $ZSH_CUSTOM/plugins/nix-shell -``` - -Then add `nix-shell` to the plugins list in `~/.zshrc`. - -### NixOS - -If you have installed `zsh` using `nix` the plugins directory is readonly since it's inside of the nix store. -To get around this you can override the [`ZSH_CUSTOM` directory](https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#using-another-customization-directory). -Simply create a writable directory inside of your home directory (e.g. `$HOME/.config/oh-my-zsh`) and set `ZSH_CUSTOM` to that path inside of your `.zshrc` file. - -```sh -ZSH_CUSTOM=$HOME/.config/oh-my-zsh -``` - -After that simply install for `oh-my-zsh` as normal. - -## Plain ZSH - -Clone this repository and add the following to your `~/.zshrc`. - -```sh -source /path/to/zsh-nix-shell/nix-shell.plugin.zsh -``` - -## home-manager - -Add this repository to the [`plugins` list of your configurations](https://rycee.gitlab.io/home-manager/options.html#opt-programs.zsh.plugins): - -```nix -{ - programs.zsh = { - enable = true; - enableCompletion = true; - plugins = [ - { - name = "zsh-nix-shell"; - file = "nix-shell.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "chisui"; - repo = "zsh-nix-shell"; - rev = "v0.8.0"; - sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7"; - }; - } - ]; - }; -} -``` - -## Plugin managers - -It should be possible to install this plugin through most `zsh` plugin managers. If the one of your choice is not supported, feel free to open an issue or even better create a pull request. - -## MacOS - -On MacOS you have to have a `bash` with version `4` or greater. [See Issue 14](https://github.com/chisui/zsh-nix-shell/issues/14) - -# Usage - -Use `nix-shell` as you did before. - -Commands run with `--run` or `--command` argument are executed in `nix-shell`s default shell. In the case of `--command` you are put into a `zsh` shell afterwards. - -## `--pure` - -If you use the `--pure` flag the interactive shell will be the default shell. - -## Environment info - -If you are inside a `nix-shell` environment `IN_NIX_SHELL` will be set. The value will be `impure` or `pure` if you specified `--pure`. - -The `packages` argument is passed through as `NIX_SHELL_PACKAGES` to the shell. - -If this Variable is empty `nix-shell` was called for a specific nix expression which is stored in the `name` environment variable. - -These variables can now be used inside a theme to customize the prompt. Take a look at this [variant of the agnoster theme](https://gist.github.com/chisui/0d12bd51a5fd8e6bb52e6e6a43d31d5e#file-agnoster-nix-zsh-theme) for an example of how this might look. - -![example prompt](https://gist.githubusercontent.com/chisui/0d12bd51a5fd8e6bb52e6e6a43d31d5e/raw/8787d8e234e895b2c74194936290a0da9be539ff/example.png) - -![example prompt for projects](https://gist.githubusercontent.com/chisui/0d12bd51a5fd8e6bb52e6e6a43d31d5e/raw/ea75cad507e2899b9b6d6ce423330641911110d8/exampleProject.png) - -# Limitations - -## Shell hooks - -Shell hooks are supported in general. Since they are executed inside of `bash` before the `zsh` shell is spawned they aren't executed in the same environment. This means that things like aliases won't work. - -## Zsh dotfiles - -The normal zsh dotfiles are sourced after the nix-shell is opened. This means that you have to take into account that these files may override variables set by nix-shell. - -# Contributing - -Please do. Pull requests welcome. diff --git a/pkgs/zsh/plugins/nix-shell/nix-shell.plugin.zsh b/pkgs/zsh/plugins/nix-shell/nix-shell.plugin.zsh deleted file mode 100644 index e0291cb..0000000 --- a/pkgs/zsh/plugins/nix-shell/nix-shell.plugin.zsh +++ /dev/null @@ -1,82 +0,0 @@ - -NIX_SHELL_PLUGIN_DIR=${0:a:h} - -which bash > /dev/null 2>&1 -if [ "$?" -ne "0" ]; then - echo - echo " WARNING: bash is not installed." - echo " for zsh-nix-shell to work bash has to be in PATH" - echo -fi - - -# extracts packages argument from args and passes them in $NIX_SHELL_PACKAGES variable. -function nix-shell() { - local -a ARGS; ARGS=("$@") - local NIX_SHELL_PACKAGES="${NIX_SHELL_PACKAGES}" - - # extract -p|--packages argument into NIX_SHELL_PACKAGES - local IN_PACKAGES=0 - local PURE=0 - while [[ ${#ARGS[@]} -gt 0 ]] - do - key=${ARGS[1]} - # enter "--packages packages..." mode - if [[ $key = "-p" || $key = "--packages" ]] - then - IN_PACKAGES=1 - NIX_SHELL_PACKAGES+=${NIX_SHELL_PACKAGES:+ }${ARGS[2]} - ARGS=("${ARGS[@]:1}") - - # skip "--arg name value" argument - elif [[ $key = "--arg" ]] - then - IN_PACKAGES=0 - ARGS=("${ARGS[@]:2}") - - elif [[ $key = "--pure" ]] - then - PURE=1 - - # skip all other unary arguments - elif [[ $key == "-"* ]] - then - IN_PACKAGES=0 - ARGS=("${ARGS[@]:1}") - - # If we don't have any argument prefix we are either in package mode - # or we have encountered the path argument - elif [[ $IN_PACKAGES = 1 ]] - then - NIX_SHELL_PACKAGES+=" $key" - fi - ARGS=("${ARGS[@]:1}") - done - - # call real nix shell - if [[ $PURE = 1 ]] - then - # if you use --pure you get bash - command nix-shell "$@" - else - NIX_EXECUTING_SHELL=$(readlink -f /proc/$$/exe) - if [[ -z "$NIX_EXECUTING_SHELL" ]] && command -v lsof &> /dev/null - then - NIX_EXECUTING_SHELL=$(lsof -p $$ | awk '$4=="txt" {print $9}' | head -n 1) - fi - if [[ -z "$NIX_EXECUTING_SHELL" ]] && command -v zsh &> /dev/null - then - NIX_EXECUTING_SHELL="zsh" - fi - if [[ -z "$NIX_EXECUTING_SHELL" ]] - then - echo "could not determine executing shell. please install `lsof` or `zsh` directly to your PATH" - echo "If this error persists create an issue at https://github.com/chisui/zsh-nix-shell/issues/new/choose" - return 1 - fi - NIX_SHELL_PACKAGES="$NIX_SHELL_PACKAGES" \ - NIX_BUILD_SHELL="$NIX_SHELL_PLUGIN_DIR/scripts/buildShellShim" \ - NIX_EXECUTING_SHELL=$NIX_EXECUTING_SHELL \ - command nix-shell "$@" - fi -} diff --git a/pkgs/zsh/plugins/nix-shell/scripts/buildShellShim b/pkgs/zsh/plugins/nix-shell/scripts/buildShellShim deleted file mode 100755 index 426c756..0000000 --- a/pkgs/zsh/plugins/nix-shell/scripts/buildShellShim +++ /dev/null @@ -1,26 +0,0 @@ -#! /usr/bin/env sh - -if [ "$1" = "--rcfile" ]; then - # This means the shell should stay open after executing. So we remove the last line which contains 'exit' - shift - tmp="$(cat $1)" - echo ${tmp%exit} > $1 - cat >> $1 < TERMWIDTH )); then - (( PR_PWDLEN = TERMWIDTH - promptsize )) - elif [[ "${langinfo[CODESET]}" = UTF-8 ]]; then - PR_FILLBAR="\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize) ))::${PR_HBAR}:)}" - else - PR_FILLBAR="${PR_SHIFT_IN}\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize) ))::${altchar[q]:--}:)}${PR_SHIFT_OUT}" - fi -} - -function theme_preexec { - setopt local_options extended_glob - if [[ "$TERM" = "screen" ]]; then - local CMD=${1[(wr)^(*=*|sudo|-*)]} - echo -n "\ek$CMD\e\\" - fi -} - -autoload -U add-zsh-hook -add-zsh-hook precmd theme_precmd -add-zsh-hook preexec theme_preexec - - -# Set the prompt - -# Need this so the prompt will work. -setopt prompt_subst - -# See if we can use colors. -autoload zsh/terminfo -for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do - typeset -g PR_$color="%{$terminfo[bold]$fg[${(L)color}]%}" - typeset -g PR_LIGHT_$color="%{$fg[${(L)color}]%}" -done -PR_NO_COLOUR="%{$terminfo[sgr0]%}" - -# Modify Git prompt -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} %{%G✚%}" -ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} %{%G✹%}" -ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} %{%G✖%}" -ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} %{%G➜%}" -ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} %{%G═%}" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} %{%G✭%}" - -# Use extended characters to look nicer if supported. -if [[ "${langinfo[CODESET]}" = UTF-8 ]]; then - PR_SET_CHARSET="" - PR_HBAR="─" - PR_ULCORNER="┌" - PR_LLCORNER="└" - PR_LRCORNER="┘" - PR_URCORNER="┐" -else - typeset -g -A altchar - set -A altchar ${(s..)terminfo[acsc]} - # Some stuff to help us draw nice lines - PR_SET_CHARSET="%{$terminfo[enacs]%}" - PR_SHIFT_IN="%{$terminfo[smacs]%}" - PR_SHIFT_OUT="%{$terminfo[rmacs]%}" - PR_HBAR="${PR_SHIFT_IN}${altchar[q]:--}${PR_SHIFT_OUT}" - PR_ULCORNER="${PR_SHIFT_IN}${altchar[l]:--}${PR_SHIFT_OUT}" - PR_LLCORNER="${PR_SHIFT_IN}${altchar[m]:--}${PR_SHIFT_OUT}" - PR_LRCORNER="${PR_SHIFT_IN}${altchar[j]:--}${PR_SHIFT_OUT}" - PR_URCORNER="${PR_SHIFT_IN}${altchar[k]:--}${PR_SHIFT_OUT}" -fi - -# Decide if we need to set titlebar text. -case $TERM in - xterm*) - PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}' - ;; - screen) - PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}' - ;; - *) - PR_TITLEBAR="" - ;; -esac - -# Decide whether to set a screen title -if [[ "$TERM" = "screen" ]]; then - PR_STITLE=$'%{\ekzsh\e\\%}' -else - PR_STITLE="" -fi - -# Finally, the prompt. -PROMPT='${PR_SET_CHARSET}${PR_STITLE}${(e)PR_TITLEBAR}\ -${PR_CYAN}${PR_ULCORNER}${PR_HBAR}${PR_GREY}(\ -${PR_GREEN}%${PR_PWDLEN}<...<%~%<<\ -${PR_GREY})$(ruby_prompt_info)${PR_CYAN}${PR_HBAR}${PR_HBAR}${(e)PR_FILLBAR}${PR_HBAR}${PR_GREY}(\ -${PR_GREEN}%m\ -${PR_GREY})${PR_CYAN}${PR_HBAR}${PR_URCORNER}\ - -${PR_CYAN}${PR_LLCORNER}${PR_BLUE}${PR_HBAR}(\ -${PR_YELLOW}%D{%H:%M:%S}\ -${PR_LIGHT_BLUE}%{$reset_color%}$(git_prompt_info)$(git_prompt_status)${PR_BLUE})${PR_CYAN}${PR_HBAR}\ -${PR_HBAR}\ ->${PR_NO_COLOUR} ' - -# display exitcode on the right when > 0 -return_code="%(?..%{$fg[red]%}%? ↵ %{$reset_color%})" -RPROMPT=' $return_code${PR_CYAN}${PR_HBAR}${PR_BLUE}${PR_HBAR}\ -(${PR_YELLOW}%D{%a,%b%d}${PR_BLUE})${PR_HBAR}${PR_CYAN}${PR_LRCORNER}${PR_NO_COLOUR}' - -PS2='${PR_CYAN}${PR_HBAR}\ -${PR_BLUE}${PR_HBAR}(\ -${PR_LIGHT_GREEN}%_${PR_BLUE})${PR_HBAR}\ -${PR_CYAN}${PR_HBAR}${PR_NO_COLOUR} ' diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml deleted file mode 100644 index e738999..0000000 --- a/secrets/secrets.yaml +++ /dev/null @@ -1,23 +0,0 @@ -syncthing: - user: ENC[AES256_GCM,data:DfJyEnHAC74qvy8=,iv:q5A1to6eoBkXF6uRo+OWhVoP5WnkBnEVVd66tWAI7Sc=,tag:hK3OtNXX66BT8hpxtY1a0w==,type:str] - password: ENC[AES256_GCM,data:5So/Ay3zszQl58d1ub9PmTPs0wwERa28X0Osh0qSwjaHqOewxQ==,iv:zcRrxgcO+vGnVzuXMY8BXYrc+xFHh3/RZXvC7FBKLcY=,tag:GbPqK447lfS4ME3FXTVZaA==,type:str] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age167thunwadsswd0u37tajk85wy4x7sgw6sg3j2aspcax7essmge6qwen0uz - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA2S3hLRWQrSHBQdjNhbDV2 - VmwrbUVsc0IwaDZKUndOTEMxN0kwWUtaYzJrCjJtNUdBMkhDVDB0akg2TTlqS1lF - NWJESlorR28rUGZHeEh6dFJYcEFsQnMKLS0tIFY3b0ZDSzM3SGVCZW9xcnJLc296 - ckJwQ3EzU2JzdGhnWkNnRExRNlprM28KUHkZe8FvLOAt+UVqvgOxBQdApbEXQ44v - vXW8UtZuq7GjsP5qD2MK6oKs/ZDfe+PhqiWl4ONNHvpn8rmfbQDcRw== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-10-08T16:55:41Z" - mac: ENC[AES256_GCM,data:VSOGYnpkU9gD/7JaCdIC84XHI5rHc4PhqSB64YvPehTrA4rgRGynMxSfvb+zRt+rIO8Qyhnt+i9zjsOLa9Z1F8xOx6f23oLRtguvYBNWJIhYaUvmS7lqPryvJGv3aoVvWkRAoSHyizIqXfmHvn0z/QfEst9PS72I4xf1pQu3trs=,iv:GJzYvWn1EOJ++QYW9jYrUfLAwTceAKFD078JWukMhH0=,tag:q62MpyvDneSYXSzu8S3qUQ==,type:str] - pgp: [] - unencrypted_suffix: _unencrypted - version: 3.9.1