diff --git a/.gitignore b/.gitignore index af4639f..5e943bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ .environment .firefox_env -hardware-configuration.nix diff --git a/LICENSE b/LICENSE index 7af38d8..f5b250c 100644 --- a/LICENSE +++ b/LICENSE @@ -617,59 +617,3 @@ reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attac 100 35149 100 35149 0 0 145k 0 --:--:-- --:--:-- --:--:-- 145k -h the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/README.md b/README.md index 5fc4316..df68e69 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,37 @@ randomuser's dotfiles ===================== -here's some dotfiles! +![an image of the desktop while editing this repo's flake.nix](./demo.png) -some features +features +-------- -- ``bspwm`` + ``sxhkd`` -- ``tmenu``: terminal based ``dmenu`` replacement -- uses ``pash``, the password manager -- no flakes (can't figure it out, lol) +- `bspwm` + `sxhkd` + `st` + `firefox` +- most everything on the desktop save for the browser, media viewers, and desktop background, is a terminal +- on the server, runs gitea + simple-nixos-mailserver +- built with NixOS flakes -some future things to work on are +installation +------------ -- remove ``polybar`` with a simpler, homegrown solution -- integrate a dynamic color switching mechanism - - make these more appealing, in general - - without compromising speed and system load -- compatibility with 'traditional' unix systems +`sudo nixos-rebuild --flake .#your-flake-name-here switch` -license. +if you're trying to install `netbox`, then use the `--impure` flag: -- boring legal stuff for most items in this configuration are in the LICENSE file. - - under the GPLv3 - - everything under ``config/*``, ``builds/*``, and ``modules/*``, in addition to all files that are ``*.nix``. - - NOT in ``wallpapers/*``, those are unlicensed and their legal status is unknown +`sudo nixos-rebuild --flake .#netbox switch --impure` + +for alternate installations on non-NixOS hosts, a Makefile will be made available + +things to do +------------ + +- integrate `disko` and `sops-nix` into the setup +- switch from gitea to cgit +- establish backup infrastructure for `netbox` +- move gmail-mail-bridge into mail-sync repo + * (perhaps figure out how to produce a flake for it) + +license +------- + +all materials, except `./home/wallpapers/pape.jpg`, is licensed under the GPLv3. the licensing status of `pape.jpg` is unknown. diff --git a/boxes/iso.nix b/boxes/iso.nix deleted file mode 100644 index 27de3cb..0000000 --- a/boxes/iso.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, pkgs, ... }: -{ - imports = [ - - - # Provide an initial copy of the NixOS channel so that the user - # doesn't need to run "nix-channel --update" first. - - ]; -} diff --git a/boxes/mainsail.nix b/boxes/mainsail.nix deleted file mode 100644 index 66796b5..0000000 --- a/boxes/mainsail.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ lib, config, pkgs, ...}: -{ - imports = [ - ../common/steam.nix - ../common/desktop.nix - ]; - - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/sda"; - - networking.hostName = "mainsail"; - - services.paperless = { - enable = true; - passwordFile = "/etc/paperless-password"; - port = 3004; - address = "localhost"; - extraConfig = { - PAPERLESS_URL = "https://paperless.beepboop.systems"; - }; - }; - - services.calibre-web.enable = true; - services.calibre-web.listen.port = 8080; - - programs.adb.enable = true; - users.users.usr.extraGroups = ["adbusers"]; - - services.openssh = { - enable = true; - ports = [2222]; - }; - - services.radicale = { - enable = true; - config = '' - [auth] - type = htpasswd - htpasswd_filename = radicale-passwd - htpasswd_encryption = plain - ''; - }; - - systemd.targets.sleep.enable = false; - systemd.targets.suspend.enable = false; - systemd.targets.hibernate.enable = false; - systemd.targets.hybrid-sleep.enable = false; - - services.getty.greetingLine = " - welcome to mainsail |`-:_ - ,----....____ | `+. - ( ````----....|___ | - \\ _ ````----....____ - \\ _) ```---.._ - \\ \\ - )`.\\ )`. )`. )`. )`. )`. )`. )`. )`. )`. )`. --' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' ` - "; - - environment.systemPackages = with pkgs; [ - vscodium-fhs - libreoffice - - anki-bin - ytfzf - kdenlive - libreoffice - i3 - gcc - gnumake - - scrcpy - thunderbird - mepo - ]; - - systemd.services.paperless-web-bridge = { - script = '' - ${pkgs.openssh}/bin/ssh -v -NR 3004:localhost:3004 -p 55555 useracc@beepboop.systems - ''; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "ankisyncd.service" ]; - }; - - systemd.services.radicale-web-bridge = { - script = '' - ${pkgs.openssh}/bin/ssh -v -NR 5232:localhost:5232 -p 55555 useracc@beepboop.systems - ''; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "ankisyncd.service" ]; - }; - - systemd.services.internal-ssh-bridge = { - script = '' - ${pkgs.openssh}/bin/ssh -v -NR 2222:localhost:2222 -p 55555 useracc@beepboop.systems - ''; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "ankisyncd.service" ]; - }; -} diff --git a/boxes/mainsail/default.nix b/boxes/mainsail/default.nix new file mode 100644 index 0000000..d17b946 --- /dev/null +++ b/boxes/mainsail/default.nix @@ -0,0 +1,63 @@ +{ lib, config, pkgs, ...}: +{ + imports = [ + ./hardware-configuration.nix + ../../modules/bootstrap.nix + ../../modules/common.nix + ]; + + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + + networking.hostName = "mainsail"; + + services.getty.greetingLine = " + welcome to mainsail |`-:_ + ,----....____ | `+. + ( ````----....|___ | + \\ _ ````----....____ + \\ _) ```---.._ + \\ \\ + )`.\\ )`. )`. )`. )`. )`. )`. )`. )`. )`. )`. +-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' ` + "; + + environment.systemPackages = with pkgs; [ + neovim + git + curl + ]; + + services.home-assistant = { + enable = true; + extraComponents = [ + # Components required to complete the onboarding + "netgear" + "hue" + "nest" + "esphome" + "met" + "radio_browser" + ]; + config = { + # Includes dependencies for a basic setup + # https://www.home-assistant.io/integrations/default_config/ + default_config = {}; + }; + openFirewall = true; + }; + + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; + + users.users.usr.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbhM3wj0oqjR3pUaZgpfX4Xo4dlzvBTbQ48zHyg7Pwx usr" + ]; + + system.stateVersion = "23.11"; +} diff --git a/boxes/mainsail/hardware-configuration.nix b/boxes/mainsail/hardware-configuration.nix new file mode 100644 index 0000000..9bc31a8 --- /dev/null +++ b/boxes/mainsail/hardware-configuration.nix @@ -0,0 +1,32 @@ +# 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" "ehci_pci" "ahci" "usbhid" "usb_storage" "ums_realtek" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/948aeaf8-cb7e-4f85-ae3e-1bc6a25ec156"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/617cb1ae-a788-429a-b0d4-63d46d8a4e1b"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/d82ae76c-68f4-4e70-9162-5dab5f84375b"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/boxes/mlg.nix b/boxes/mlg/default.nix similarity index 81% rename from boxes/mlg.nix rename to boxes/mlg/default.nix index 98e4369..2a7c461 100644 --- a/boxes/mlg.nix +++ b/boxes/mlg/default.nix @@ -2,10 +2,13 @@ { imports = [ - ../common/desktop.nix - ../common/nvidia.nix - ../common/gaming.nix - ../common/steam.nix + ./hardware-configuration.nix + ./nvidia.nix + ../../modules/bootstrap.nix + ../../modules/common.nix + ../../modules/x11.nix + ../../modules/discord.nix + ../../modules/gaming.nix ]; environment.systemPackages = with pkgs; [ diff --git a/boxes/mlg/hardware-configuration.nix b/boxes/mlg/hardware-configuration.nix new file mode 100644 index 0000000..99531a4 --- /dev/null +++ b/boxes/mlg/hardware-configuration.nix @@ -0,0 +1,41 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# testing +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/eada30c2-ffc5-4410-b1cf-fcea6a4040ff"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/5318-1A44"; + 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.enp58s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp7s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/boxes/mlg/home.nix b/boxes/mlg/home.nix new file mode 100644 index 0000000..8c118a1 --- /dev/null +++ b/boxes/mlg/home.nix @@ -0,0 +1,10 @@ +{ lib, inputs, config, pkgs, home, ... }: + +{ + imports = [ + ../../home/x11.nix + ../../home/chromium + ]; + + home.stateVersion = "23.11"; +} diff --git a/common/nvidia.nix b/boxes/mlg/nvidia.nix similarity index 100% rename from common/nvidia.nix rename to boxes/mlg/nvidia.nix diff --git a/boxes/netbox.nix b/boxes/netbox.nix deleted file mode 100644 index 0d032fe..0000000 --- a/boxes/netbox.nix +++ /dev/null @@ -1,207 +0,0 @@ -{ lib, config, pkgs, ... }: - -{ - imports = - [ - ../modules/mail.nix - ../common/main.nix - ]; - - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/vda"; - - networking.hostName = "netbox"; - - services.rss2email = { - enable = true; - to = "ryan@beepboop.systems"; - feeds = { - "eff" = { - url = "https://www.eff.org/rss/updates.xml"; - }; - "nixos" = { - url = "https://nixos.org/blog/announcements-rss.xml"; - }; - "drewdevault" = { - url = "https://drewdevault.com/blog/index.xml"; - }; - "nullprogram" = { - url = "https://nullprogram.com/feed/"; - }; - }; - }; - - services.fail2ban = { - enable = true; - ignoreIP = [ - "192.168.1.0/24" - ]; - extraPackages = [pkgs.ipset]; - banaction = "iptables-ipset-proto6-allports"; - - jails = { - "nginx-bruteforce" = '' - enabled = true - filter = nginx-bruteforce - logpath = /var/log/nginx/access.log - backend = auto - maxretry = 6 - findtime = 600 - ''; - - "postfix-bruteforce" = '' - enabled = true - filter = postfix-bruteforce - maxretry = 6 - findtime = 600 - ''; - }; - }; - - environment.etc = { - "fail2ban/filter.d/nginx-bruteforce.conf".text = '' - [Definition] - failregex = ^.*GET.*(matrix/server|\.php|admin|wp\-).* HTTP/\d.\d\" 404.*$ - ''; - - "fail2ban/filter.d/postfix-bruteforce.conf".text = '' - [Definition] - failregex = warning: [\w\.\-]+\[\]: SASL LOGIN authentication failed.*$ - journalmatch = _SYSTEMD_UNIT=postfix.service - ''; - }; - - users.users.useracc = { - isNormalUser = true; - extraGroups = [ "wheel" "docker" ]; - }; - - users.users.ryan = { - isNormalUser = true; - extraGroups = [ "wheel" "docker" ]; - packages = [ "browsh" ]; - }; - - users.users.paperlesspassthrough = { - isNormalUser = true; - }; - - environment.systemPackages = with pkgs; [ - neovim - # nothing more needed, at the moment - ]; - - services.openssh = { - enable = true; - ports = [55555]; - }; - - services.endlessh.enable = true; - services.endlessh.port = 22; - services.vaultwarden.enable = true; - services.vaultwarden.config = { - DOMAIN = "https://bitwarden.beepboop.systems"; - SIGNUPS_ALLOWED = false; - }; - - networking.usePredictableInterfaceNames = false; - - services.nixosmail.enable = true; - - services.gitea = { - enable = true; - appName = "crappy code"; # Give the site a name - database = { - type = "postgres"; - passwordFile = "/etc/gittea-pass"; - }; - settings.server = { - DOMAIN = "git.beepboop.systems"; - ROOT_URL = "https://git.beepboop.systems/"; - HTTP_PORT = 3001; - }; - }; - - services.postgresql = { - enable = true; # Ensure postgresql is enabled - authentication = '' - local gitea all ident map=gitea-users - ''; - identMap = # Map the gitea user to postgresql - '' - gitea-users gitea gitea - ''; - }; - - services.nginx.enable = true; - services.nginx.clientMaxBodySize = "100m"; - - services.nginx.virtualHosts."beepboop.systems" = { - forceSSL = true; - enableACME = true; - root = "/var/www/beepboop.systems"; - }; - - services.nginx.virtualHosts."git.beepboop.systems" = { - forceSSL = true; - enableACME = true; - locations."/".proxyPass = "http://localhost:3001"; - }; - - services.nginx.virtualHosts."paperless.beepboop.systems" = { - forceSSL = true; - enableACME = true; - locations."/".proxyPass = "http://localhost:3004"; - }; - - services.nginx.virtualHosts."bitwarden.beepboop.systems" = { - forceSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://127.0.0.1:8000"; - }; - }; - - services.nginx.virtualHosts."radicale.beepboop.systems" = { - forceSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://127.0.0.1:5232"; - extraConfig = '' - proxy_set_header X-Script-Name /; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_pass_header Authorization; - ''; - }; - }; - - services.nginx.virtualHosts."skillissue.agency" = { - forceSSL = true; - enableACME = true; - root = "/var/www/skillissue.agency"; - }; - - security.acme = { - acceptTerms = true; - email = "nickforanick@protonmail.com"; - }; - - services.roundcube = { - enable = true; - # this is the url of the vhost, not necessarily the same as the fqdn of - # the mailserver - hostName = "cube.beepboop.systems"; - extraConfig = '' - # starttls needed for authentication, so the fqdn required to match - # the certificate - $config['smtp_server'] = "tls://${config.mailserver.fqdn}"; - $config['smtp_user'] = "%u"; - $config['smtp_pass'] = "%p"; - ''; - }; - - networking.firewall = { - enable = true; - allowedTCPPorts = [ 5232 55555 22 80 443 ]; - }; -} diff --git a/boxes/netbox/default.nix b/boxes/netbox/default.nix new file mode 100644 index 0000000..e21f423 --- /dev/null +++ b/boxes/netbox/default.nix @@ -0,0 +1,465 @@ +{ lib, config, pkgs, ... }: + +let + cgitrc = pkgs.writeText "cgitrc" '' + css=/static/cgit.css + logo=/static/logo.png + favicon=/static/favicon.ico + root-title=beepboop.systems + root-desc=quality git hosting + + readme=:README + readme=:readme + readme=:readme.txt + readme=:README.txt + readme=:readme.md + readme=:README.md + + remove-suffix=1 + section-from-path=1 + + section-sort=0 + + section=meta + + repo.url=about + repo.path=/doesnt/exist + repo.desc=about this site + + section=other services at beepboop.systems + + repo.url=bitwarden + repo.path=/doesnt/exist + repo.desc=a simple password manager + + repo.url=radicale + repo.path=/doesnt/exist + repo.desc=a simple calendar server + + repo.url=roundcube + repo.path=/doesnt/exist + repo.desc=mail.beepboop.systems webmail + + repo.url=gitea + repo.path=/doesnt/exist + repo.desc=real git hosting services (until this one is fully operational) + + section=projects + + repo.url=advent + repo.path=/var/lib/git/advent + repo.desc=advent of code solutions + + repo.url=desmos-computer + repo.path=/var/lib/git/desmos-computer + repo.desc=a minimal ISA implemented in the Desmos graphing calculator + + repo.url=dot_testing + repo.path=/var/lib/git/dot_testing + repo.desc=configuration files for NixOS/GNU+Linux boxes + + repo.url=esgd + repo.path=/var/lib/git/esgd + repo.desc=the exceedingly simple gopher daemon + + repo.url=mail-sync + repo.path=/var/lib/git/mail-sync + repo.desc=synchronize mail from walled gardens + + repo.url=mastosnake + repo.path=/var/lib/git/mastosnake + repo.desc=a low quality clone of Twitter Plays Snake + + repo.url=secmsg + repo.path=/var/lib/git/secmsg + repo.desc=a stupid (in)secure messaging client thing + + repo.url=ultimate + repo.path=/var/lib/git/ultimate + repo.desc=ultimate tic tac toe solving engine + + repo.url=wordlefish + repo.path=/var/lib/git/wordlefish + repo.desc=use information theory to solve wordle puzzles + + section=irc robots + + repo.url=botanybot + repo.path=/var/lib/git/botanybot + repo.desc=water bots on ~.club + + repo.url=coinminer + repo.path=/var/lib/git/coinminer + repo.desc=mine fake coins on irc + + repo.url=chaosbot + repo.path=/var/lib/git/chaosbot + repo.desc=robot to protect a user on chaos + + repo.url=modbot + repo.path=/var/lib/git/modbot + repo.desc=modular irc robot + + repo.url=pychaos + repo.path=/var/lib/git/pychaos + repo.desc=python chaos bot + + repo.url=universalducks + repo.path=/var/lib/git/universalducks + repo.desc=cross channel irc ducks + ''; +in { + imports = + [ + ./hardware-configuration.nix + ../../modules/bootstrap.nix + ../../builds/gmail_mail_bridge.nix + ]; + + networking.networkmanager.enable = true; + + time.timeZone = "America/Chicago"; + + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + + environment.systemPackages = with pkgs; [ + curl + htop + git + tree + dig + htop + gnumake + neovim + ]; + + services.gmail_mail_bridge.enable = true; + + system.copySystemConfiguration = true; + system.stateVersion = "23.05"; # don't change this, lol + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/vda"; + + services.sslh = { + enable = true; + settings.protocols = [ + { + host = "localhost"; + name = "ssh"; + port = "55555"; + service = "ssh"; + } + { + host = "localhost"; + name = "tls"; + port = "442"; + } + ]; + }; + + # cgit + users = { + groups.git = { }; + users.git = { + createHome = true; + home = /var/lib/git; + isSystemUser = true; + shell = "${pkgs.git}/bin/git-shell"; + group = "git"; + }; + }; + + services.fcgiwrap = { enable = true; user = "git"; group = "git"; }; + + networking.hostName = "netbox"; + + services.radicale = { + enable = true; + config = '' + [auth] + type = htpasswd + htpasswd_filename = radicale-passwd + htpasswd_encryption = plain + ''; + }; + + services.rss2email = { + enable = true; + to = "ryan@beepboop.systems"; + feeds = { + "eff" = { + url = "https://www.eff.org/rss/updates.xml"; + }; + "nixos" = { + url = "https://nixos.org/blog/announcements-rss.xml"; + }; + "drewdevault" = { + url = "https://drewdevault.com/blog/index.xml"; + }; + "nullprogram" = { + url = "https://nullprogram.com/feed/"; + }; + }; + }; + + services.fail2ban = { + enable = true; + ignoreIP = [ + "192.168.1.0/24" + ]; + extraPackages = [pkgs.ipset]; + banaction = "iptables-ipset-proto6-allports"; + + jails = { + "nginx-bruteforce" = '' + enabled = true + filter = nginx-bruteforce + logpath = /var/log/nginx/access.log + backend = auto + maxretry = 6 + findtime = 600 + ''; + + "postfix-bruteforce" = '' + enabled = true + filter = postfix-bruteforce + maxretry = 6 + findtime = 600 + ''; + }; + }; + + environment.etc = { + "fail2ban/filter.d/nginx-bruteforce.conf".text = '' + [Definition] + failregex = ^.*GET.*(matrix/server|\.php|admin|wp\-).* HTTP/\d.\d\" 404.*$ + ''; + + "fail2ban/filter.d/postfix-bruteforce.conf".text = '' + [Definition] + failregex = warning: [\w\.\-]+\[\]: SASL LOGIN authentication failed.*$ + journalmatch = _SYSTEMD_UNIT=postfix.service + ''; + }; + + users.users.ryan = { + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbhM3wj0oqjR3pUaZgpfX4Xo4dlzvBTbQ48zHyg7Pwx usr" + ]; + isNormalUser = true; + extraGroups = [ "wheel" "docker" ]; + }; + + services.openssh = { + enable = true; + ports = [55555]; + }; + + services.endlessh.enable = true; + services.endlessh.port = 22; + services.vaultwarden.enable = true; + services.vaultwarden.config = { + DOMAIN = "https://bitwarden.beepboop.systems"; + SIGNUPS_ALLOWED = false; + }; + + networking.usePredictableInterfaceNames = false; + + services.gitea = { + enable = true; + appName = "crappy code"; # Give the site a name + database = { + type = "postgres"; + passwordFile = "/etc/gittea-pass"; + }; + settings.server = { + DOMAIN = "git.beepboop.systems"; + ROOT_URL = "https://git.beepboop.systems/"; + HTTP_PORT = 3001; + }; + }; + + services.postgresql = { + enable = true; # Ensure postgresql is enabled + authentication = '' + local gitea all ident map=gitea-users + ''; + identMap = # Map the gitea user to postgresql + '' + gitea-users gitea gitea + ''; + }; + + services.nginx.enable = true; + services.nginx.clientMaxBodySize = "100m"; + services.nginx.defaultSSLListenPort = 442; + + services.nginx.virtualHosts."beepboop.systems" = { + forceSSL = true; + enableACME = true; + root = "/var/www/beepboop.systems"; + + locations."~* ^/static/(.+.(ico|css))$" = { + extraConfig = '' + alias ${pkgs.cgit}/cgit/$1; + ''; + }; + locations."/static/logo.png" = { + extraConfig = '' + try_files /icon.png /icon.png; + ''; + }; + locations."/about" = { + extraConfig = '' + try_files /about.html /about.html; + ''; + }; + locations."/bitwarden" = { + extraConfig = '' + return 301 https://bit.beepboop.systems; + ''; + }; + locations."/gitea" = { + extraConfig = '' + return 301 https://git.beepboop.systems/rndusr; + ''; + }; + locations."/radicale" = { + extraConfig = '' + return 301 https://cal.beepboop.systems; + ''; + }; + locations."/roundcube" = { + extraConfig = '' + return 301 https://mail.beepboop.systems; + ''; + }; + locations."~ \\.git" = { + extraConfig = '' + client_max_body_size 0; + + include ${pkgs.nginx}/conf/fastcgi_params; + fastcgi_param SCRIPT_FILENAME ${pkgs.git}/bin/git-http-backend; + fastcgi_param GIT_HTTP_EXPORT_ALL ""; + fastcgi_param GIT_PROJECT_ROOT /var/lib/git; + fastcgi_param PATH_INFO $uri; + + # Forward REMOTE_USER as we want to know when we are authenticated + fastcgi_param REMOTE_USER $remote_user; + fastcgi_pass unix:${config.services.fcgiwrap.socketAddress}; + ''; + }; + locations."/" = { + extraConfig = '' + include ${pkgs.nginx}/conf/fastcgi_params; + fastcgi_param CGIT_CONFIG ${cgitrc}; + fastcgi_param SCRIPT_FILENAME ${pkgs.cgit}/cgit/cgit.cgi; + fastcgi_split_path_info ^(/?)(.+)$; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param QUERY_STRING $args; + fastcgi_param HTTP_HOST $server_name; + fastcgi_pass unix:${config.services.fcgiwrap.socketAddress}; + ''; + }; + }; + + services.nginx.virtualHosts."git.beepboop.systems" = { + forceSSL = true; + enableACME = true; + locations."/".proxyPass = "http://localhost:3001"; + }; + + services.nginx.virtualHosts."bit.beepboop.systems" = { + forceSSL = true; + enableACME = true; + globalRedirect = "bitwarden.beepboop.systems"; + }; + + services.nginx.virtualHosts."bitwarden.beepboop.systems" = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://127.0.0.1:8000"; + }; + }; + + services.nginx.virtualHosts."radicale.beepboop.systems" = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://127.0.0.1:5232"; + extraConfig = '' + proxy_set_header X-Script-Name /; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass_header Authorization; + ''; + }; + }; + + services.nginx.virtualHosts."calendar.beepboop.systems" = { + forceSSL = true; + enableACME = true; + globalRedirect = "radicale.beepboop.systems"; + }; + + services.nginx.virtualHosts."cal.beepboop.systems" = { + forceSSL = true; + enableACME = true; + globalRedirect = "radicale.beepboop.systems"; + }; + + services.nginx.virtualHosts."skillissue.agency" = { + forceSSL = true; + enableACME = true; + root = "/var/www/skillissue.agency"; + }; + + security.acme = { + acceptTerms = true; + email = "nickforanick@protonmail.com"; + }; + + services.roundcube = { + enable = true; + # this is the url of the vhost, not necessarily the same as the fqdn of + # the mailserver + hostName = "cube.beepboop.systems"; + extraConfig = '' + # starttls needed for authentication, so the fqdn required to match + # the certificate + $config['smtp_server'] = "tls://${config.mailserver.fqdn}"; + $config['smtp_user'] = "%u"; + $config['smtp_pass'] = "%p"; + ''; + }; + + services.nginx.virtualHosts."roundcube.beepboop.systems" = { + forceSSL = true; + enableACME = true; + globalRedirect = "cube.beepboop.systems"; + }; + + services.nginx.virtualHosts."mail.beepboop.systems" = { + forceSSL = true; + enableACME = true; + locations."/bridge-submit" = { + extraConfig = '' + proxy_pass http://localhost:8041; + ''; + }; + locations."/" = { + extraConfig = '' + return 301 https://cube.beepboop.systems; + ''; + }; + }; + + networking.firewall = { + enable = true; + allowedTCPPorts = [ 80 443 ]; + }; +} diff --git a/boxes/netbox/hardware-configuration.nix b/boxes/netbox/hardware-configuration.nix new file mode 100644 index 0000000..89e88a0 --- /dev/null +++ b/boxes/netbox/hardware-configuration.nix @@ -0,0 +1,37 @@ +# 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 = [ ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/a57b82ca-7bfd-458e-b3e8-4962511cc0b8"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/DF39-1ECE"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/57fbd850-1ced-4e21-9e52-4f3b529c61b0"; } + ]; + + # 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.ens3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + virtualisation.hypervGuest.enable = true; +} diff --git a/boxes/virtbox.nix b/boxes/virtbox.nix deleted file mode 100644 index 9ae3730..0000000 --- a/boxes/virtbox.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ lib, config, pkgs, ...}: - -{ - imports = [ - ../common/desktop.nix - ]; - - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/vda"; - - networking.hostName = "virtbox"; -} diff --git a/boxes/virtbox/default.nix b/boxes/virtbox/default.nix new file mode 100644 index 0000000..81e64ab --- /dev/null +++ b/boxes/virtbox/default.nix @@ -0,0 +1,18 @@ +{ lib, config, pkgs, ...}: + +{ + imports = [ + ./hardware-configuration.nix + ../../modules/bootstrap.nix + ../../modules/common.nix + ../../modules/x11.nix + ../../modules/discord.nix + ]; + + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/vda"; + + networking.hostName = "virtbox"; + + system.stateVersion = "23.11"; +} diff --git a/boxes/virtbox/hardware-configuration.nix b/boxes/virtbox/hardware-configuration.nix new file mode 100644 index 0000000..c2a86c1 --- /dev/null +++ b/boxes/virtbox/hardware-configuration.nix @@ -0,0 +1,31 @@ +# 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 + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/7b70ab88-296c-4737-90b2-267cb2432dc1"; + fsType = "ext4"; + }; + + 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.enp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/boxes/virtbox/home.nix b/boxes/virtbox/home.nix new file mode 100644 index 0000000..144dd0e --- /dev/null +++ b/boxes/virtbox/home.nix @@ -0,0 +1,9 @@ +{ lib, inputs, config, pkgs, home, ... }: + +{ + imports = [ + ../../home/x11.nix + ]; + + home.stateVersion = "23.11"; +} diff --git a/boxes/x230t/default.nix b/boxes/x230t/default.nix new file mode 100644 index 0000000..e2a89c8 --- /dev/null +++ b/boxes/x230t/default.nix @@ -0,0 +1,48 @@ +{ lib, config, pkgs, ...}: + +{ + imports = [ + ./hardware-configuration.nix + ../../modules/bootstrap.nix + ../../modules/common.nix + ../../modules/x11.nix + ../../modules/tlp.nix + ../../modules/media.nix + ../../modules/anki.nix + ../../modules/power-control.nix + ../../modules/adb.nix + ]; + + environment.systemPackages = with pkgs; [ + xscreensaver + thunderbird + hue-cli + bluetuith + ]; + + hardware.bluetooth = { + enable = true; + }; + + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="input", KERNEL=="event[0-20]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", MODE:="0666" GROUP="usr", SYMLINK+="input/touchscreen" + ''; + + users.users.usr.extraGroups = [ "input" ]; + + services.getty.autologinUser = "usr"; + + boot.loader = { + grub.timeoutStyle = "hidden"; + timeout = 0; + grub.enable = true; + grub.device = "/dev/sda"; + }; + + hardware.pulseaudio.enable = true; + + + networking.hostName = "x230t"; + + system.stateVersion = "23.11"; +} diff --git a/boxes/x230t/hardware-configuration.nix b/boxes/x230t/hardware-configuration.nix new file mode 100644 index 0000000..d6f6f3c --- /dev/null +++ b/boxes/x230t/hardware-configuration.nix @@ -0,0 +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") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/772f67d6-9434-42f1-aa3e-153e41affe4c"; + fsType = "ext4"; + }; + + 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.enp0s25.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/boxes/x230t/home.nix b/boxes/x230t/home.nix new file mode 100644 index 0000000..8c118a1 --- /dev/null +++ b/boxes/x230t/home.nix @@ -0,0 +1,10 @@ +{ lib, inputs, config, pkgs, home, ... }: + +{ + imports = [ + ../../home/x11.nix + ../../home/chromium + ]; + + home.stateVersion = "23.11"; +} diff --git a/boxes/xps.nix b/boxes/xps.nix deleted file mode 100644 index 9bba5fb..0000000 --- a/boxes/xps.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ lib, config, pkgs, ...}: - -{ - imports = [ - ../common/desktop.nix - ../common/steam.nix - ]; - - environment.systemPackages = with pkgs; [ - gnome.cheese - musescore - libsForQt5.kdenlive - xdotool - texlive.combined.scheme-full - zathura - lilypond - virt-manager -# virtualbox - xsane - android-studio - mpc-cli - emacs - nyxt - cmus - ]; - -# users.extraGroups.vboxusers.members = [ "usr" ]; -# virtualisation.virtualbox.host.enable = true; -# virtualisation.virtualbox.host.enableExtensionPack = true; - - services.tlp.enable = true; - - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - services.printing.enable = true; - services.avahi.enable = true; - services.avahi.nssmdns = true; - # for a WiFi printer - services.avahi.openFirewall = true; - - networking.nameservers = [ "1.1.1.1" "9.9.9.9" ]; - - networking.hostName = "xps"; - - virtualisation.libvirtd.enable = true; - programs.dconf.enable = true; - users.users.usr.extraGroups = [ "libvirtd" ]; -} diff --git a/builds/flake.lock b/builds/flake.lock new file mode 100644 index 0000000..c5ee110 --- /dev/null +++ b/builds/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1703467016, + "narHash": "sha256-/5A/dNPhbQx/Oa2d+Get174eNI3LERQ7u6WTWOlR1eQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d02d818f22c777aa4e854efc3242ec451e5d462a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/builds/flake.nix b/builds/flake.nix new file mode 100644 index 0000000..350b96a --- /dev/null +++ b/builds/flake.nix @@ -0,0 +1,28 @@ +{ + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + + outputs = + { nixpkgs, ... }: + let + inherit (nixpkgs) lib; + withSystem = + f: + lib.fold lib.recursiveUpdate { } ( + map f [ + "x86_64-linux" + ] + ); + mkPackages = pkgs: { + st = pkgs.callPackage ./st.nix { }; + rebuild = pkgs.callPackage ./rebuild.nix { }; + utils = pkgs.callPackage ./utils.nix { }; + }; + in + withSystem ( + system: { + overlays.default = final: _: mkPackages final; + + packages.${system} = mkPackages nixpkgs.legacyPackages.${system}; + } + ); +} diff --git a/builds/gmail_mail_bridge.nix b/builds/gmail_mail_bridge.nix new file mode 100644 index 0000000..a81985c --- /dev/null +++ b/builds/gmail_mail_bridge.nix @@ -0,0 +1,19 @@ +{ lib, pkgs, config, ... }: +let + cfg = config.services.gmail_mail_bridge; + appEnv = pkgs.python3.withPackages (p: with p; [ waitress (callPackage ./gmail_mail_bridge/default.nix {}) ]); +in { + options.services.gmail_mail_bridge = { + enable = lib.mkEnableOption "Enable the gmail_mail_bridge"; + }; + + config = lib.mkIf cfg.enable { + systemd.services.gmail_mail_bridge = { + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = "${appEnv}/bin/waitress-serve --port=8041 gmail_mail_bridge:app"; + StandardOutput = "journal"; + }; + }; + }; +} diff --git a/builds/gmail_mail_bridge/.gitignore b/builds/gmail_mail_bridge/.gitignore new file mode 100644 index 0000000..aaca2e2 --- /dev/null +++ b/builds/gmail_mail_bridge/.gitignore @@ -0,0 +1 @@ +__pycache_/ diff --git a/builds/gmail_mail_bridge/README b/builds/gmail_mail_bridge/README new file mode 100644 index 0000000..eae7b1c --- /dev/null +++ b/builds/gmail_mail_bridge/README @@ -0,0 +1,10 @@ +synchronize email from gmail accounts whose OAuth access is heavily restricted + +background +---------- + +my school district disabled external OAuth access to email, which is not cool. this script gets around this and creates a bridge so you can recieve emails from your school email. + +do note that this is heavily unpolished and most definately insecure. there are some hardcoded credentials (which you can change, it just takes a little technical know-how) + +have fun! diff --git a/builds/gmail_mail_bridge/default.nix b/builds/gmail_mail_bridge/default.nix new file mode 100644 index 0000000..bde908a --- /dev/null +++ b/builds/gmail_mail_bridge/default.nix @@ -0,0 +1,20 @@ +{ pkgs, pythonPackages ? (import {}).python3Packages }: +pythonPackages.buildPythonPackage { + name = "gmail_mail_bridge"; + src = ./gmail_mail_bridge; + + propagatedBuildInputs = [ pythonPackages.flask pkgs.system-sendmail ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/${pythonPackages.python.sitePackages} + cp -r . $out/${pythonPackages.python.sitePackages}/gmail_mail_bridge + + runHook postInstall + ''; + + shellHook = "export FLASK_APP=gmail_mail_bridge"; + + format = "other"; +} diff --git a/builds/gmail_mail_bridge/gmail_mail_bridge/__init__.py b/builds/gmail_mail_bridge/gmail_mail_bridge/__init__.py new file mode 100644 index 0000000..e6a7241 --- /dev/null +++ b/builds/gmail_mail_bridge/gmail_mail_bridge/__init__.py @@ -0,0 +1,37 @@ +from flask import Flask +from flask import request +from flask import redirect +from flask import abort + +import logging + +import smtplib +import email + +from subprocess import Popen, PIPE, STDOUT + +pre_shared_secret = "amongus sussy imposter" +to = "ryan@beepboop.systems" + +app = Flask(__name__) + +def handle_post(request): + msg = email.message_from_string(request.form["payload"]) + del msg["To"] + msg["To"] = to + if not msg["From"]: + msg["From"] = "unknown-sender@mail.beepboop.systems" + + s = smtplib.SMTP('localhost') + s.send_message(msg) + s.quit() + +@app.route("/bridge-submit", methods = ["GET", "POST"]) +def testing(): + if request.method == 'POST': + data = request.form + if data['auth'] == pre_shared_secret: + handle_post(request) + else: + return 'you didn\'t use post' + return "default answer" diff --git a/builds/gmail_mail_bridge/shell.nix b/builds/gmail_mail_bridge/shell.nix new file mode 100644 index 0000000..abd9f69 --- /dev/null +++ b/builds/gmail_mail_bridge/shell.nix @@ -0,0 +1,12 @@ +{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11") {} }: + +pkgs.mkShell { + packages = [ + (pkgs.python3.withPackages (ps: [ + ps.flask + ])) + + pkgs.curl + pkgs.jq + ]; +} diff --git a/builds/gmail_mail_bridge/sync.gas b/builds/gmail_mail_bridge/sync.gas new file mode 100644 index 0000000..0df9d17 --- /dev/null +++ b/builds/gmail_mail_bridge/sync.gas @@ -0,0 +1,23 @@ +// google-side synchronization +// add a minute-wise trigger for mail synchronization +// go to the sidebar, select triggers, add a new one, configure it +// to run syncMail every minute + +function syncMail() { + var threads = GmailApp.search("label:need_processing"); + var label = GmailApp.getUserLabelByName("need_processing"); + for (var thread of threads) { + for (var message of GmailApp.getMessagesForThread(thread)) { + var formData = { + auth: 'amongus sussy imposter', + payload: message.getRawContent(), + }; + var options = { + 'method' : 'POST', + 'payload' : formData + }; + var resp = UrlFetchApp.fetch('https://mail.beepboop.systems/bridge-submit', options); + } + thread.removeLabel(label); + } +} diff --git a/builds/pash.nix b/builds/pash.nix deleted file mode 100644 index 32531ee..0000000 --- a/builds/pash.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ stdenv -, lib -, bash -, gnupg -, makeWrapper -, fetchgit -}: - -stdenv.mkDerivation rec { - pname = "pash"; - version = "1.00"; - - src = fetchgit { - url = "https://git.beepboop.systems/rndusr/pash"; - sha256 = "sha256-0L3N7F4BwVdu4rR5xpUEIHcX/x64Gni8JTUki5kGH24="; - }; - - nativeBuildInputs = [ makeWrapper gnupg ]; - - installPhase = '' - mkdir -p $out/bin - cp $src/pash $out/bin/pash - wrapProgram $out/bin/pash --prefix PATH : ${lib.makeBinPath [ bash ]} - ''; - - phases = [ "installPhase" ]; -} diff --git a/builds/rebuild/rebuild b/builds/rebuild/rebuild index aaec55e..33b5995 100755 --- a/builds/rebuild/rebuild +++ b/builds/rebuild/rebuild @@ -1,2 +1,6 @@ cd ~/dot_testing -sudo nixos-rebuild -I nixos-config=./boxes/$(hostname).nix switch $@ +if [ -f "flake.nix" ]; then + sudo nixos-rebuild --flake . switch $@ +else + sudo nixos-rebuild -I nixos-config=./boxes/$(hostname).nix switch $@ +fi diff --git a/builds/st.nix b/builds/st.nix index fefa83b..0121835 100644 --- a/builds/st.nix +++ b/builds/st.nix @@ -12,14 +12,14 @@ stdenv.mkDerivation rec { pname = "st"; - version = "69.19"; + version = "1.02"; src = fetchgit { url = "https://git.beepboop.systems/rndusr/st"; sha256 = "sha256-zdID1SUnTO/zl90EG8TguBNYYCnrnqFnSLz32kQZbng="; }; - nativeBuildInputs = [ pkg-config fontconfig freetype ncurses]; + nativeBuildInputs = [ pkg-config fontconfig freetype ncurses ]; buildInputs = [ libX11 libXft ] ++ extraLibs; buildPhase = '' diff --git a/builds/utils.nix b/builds/utils.nix index d4612be..62dfb9e 100644 --- a/builds/utils.nix +++ b/builds/utils.nix @@ -1,35 +1,45 @@ { stdenv , lib +# for statusbar +, pkg-config +, libxcb +# shell scripts stuff +, makeWrapper , sxhkd , bash , feh , jq +, ffmpeg +, fzy , figlet , curl +, ytfzf , xrandr -, makeWrapper }: stdenv.mkDerivation rec { pname = "utils"; - version = "1.00"; + version = "1.01"; src = ./utils; - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ bash feh xrandr jq curl ]; + nativeBuildInputs = [ makeWrapper pkg-config libxcb ]; + buildInputs = [ libxcb bash feh xrandr jq curl fzy ytfzf ffmpeg ]; - buildPhase = ""; + buildPhase = '' + ls + make + ''; installPhase = '' mkdir -p $out/bin for i in $(ls $src/sh); do cp $src/sh/$i $out/bin - wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ sxhkd bash feh xrandr jq figlet curl ]} + ln -sf $out/bin/tmenu_run $out/bin/regenerate + wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ sxhkd bash feh xrandr jq figlet curl fzy ytfzf ffmpeg ]} done + + cp c/status/main $out/bin/statusbar ''; - - phases = [ "buildPhase" "installPhase" ]; } - diff --git a/builds/utils/Makefile b/builds/utils/Makefile new file mode 100644 index 0000000..c7422f8 --- /dev/null +++ b/builds/utils/Makefile @@ -0,0 +1,3 @@ +.PHONY: main +main: + make -C c/status -f Makefile diff --git a/builds/utils/c/status/.gitignore b/builds/utils/c/status/.gitignore new file mode 100644 index 0000000..87e54c2 --- /dev/null +++ b/builds/utils/c/status/.gitignore @@ -0,0 +1,2 @@ +main +*.o diff --git a/builds/utils/c/status/Makefile b/builds/utils/c/status/Makefile new file mode 100644 index 0000000..46a4153 --- /dev/null +++ b/builds/utils/c/status/Makefile @@ -0,0 +1,9 @@ +LDFLAGS=`pkg-config --cflags --libs xcb` +CFLAGS=-ggdb -fsanitize=address +main: battery.o bspwm.o time.o battstatus.o + +clean: + rm *.o main + +run: + ./main diff --git a/builds/utils/c/status/README b/builds/utils/c/status/README new file mode 100644 index 0000000..25c36dd --- /dev/null +++ b/builds/utils/c/status/README @@ -0,0 +1,4 @@ +status +------ + +a simple statusbar script thing (tm) diff --git a/builds/utils/c/status/battery.c b/builds/utils/c/status/battery.c new file mode 100644 index 0000000..987ee0e --- /dev/null +++ b/builds/utils/c/status/battery.c @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "battery.h" +#include "common.h" + +/* config contains a path to the battery */ +int mod_battery(char *config, char *name, char *pipename) { + struct message msg; + strcpy(msg.name, name); + + int fd = open(pipename, O_WRONLY); + int battery; + int recvd; + + chdir("/sys/class/power_supply"); + chdir(config); + + for(;;) { + battery = open("capacity", O_RDONLY); + recvd = read(battery, msg.content, 3); + msg.content[3] = '\0'; + if (msg.content[2] == '\n') { + msg.content[2] = '\0'; + } + close(battery); + write(fd, &msg, sizeof(msg)); + + sleep(30); + } + + return 0; +} diff --git a/builds/utils/c/status/battery.h b/builds/utils/c/status/battery.h new file mode 100644 index 0000000..ee7eeed --- /dev/null +++ b/builds/utils/c/status/battery.h @@ -0,0 +1,6 @@ +#ifndef STATUS_BATTERY_H +#define STATUS_BATTERY_H + +int mod_battery(char *config, char *name, char *pipename); + +#endif diff --git a/builds/utils/c/status/battstatus.c b/builds/utils/c/status/battstatus.c new file mode 100644 index 0000000..3646ccb --- /dev/null +++ b/builds/utils/c/status/battstatus.c @@ -0,0 +1,48 @@ +#include +#include +#include +#include + +#include "battstatus.h" +#include "common.h" + +int mod_battstatus(char *config, char *name, char *pipename) { + char status; + int battery; + struct message msg; + strcpy(msg.name, name); + + int fd = open(pipename, O_WRONLY); + + chdir("/sys/class/power_supply"); + chdir(config); + + for(;;) { + battery = open("status", O_RDONLY); + read(battery, msg.content, 1); + switch(msg.content[0]) { + case 'N': /* not charging */ + msg.content[0] = '-'; + break; + case 'C': /* charging */ + msg.content[0] = '^'; + break; + case 'D': /* discharging */ + msg.content[0] = 'U'; + break; + case 'U': /* unknown */ + msg.content[0] = '?'; + break; + default: /* what's going on? */ + msg.content[0] = '!'; + break; + } + msg.content[1] = '\0'; + close(battery); + write(fd, &msg, sizeof(msg)); + + sleep(30); + } + + return 0; +} diff --git a/builds/utils/c/status/battstatus.h b/builds/utils/c/status/battstatus.h new file mode 100644 index 0000000..0c5366c --- /dev/null +++ b/builds/utils/c/status/battstatus.h @@ -0,0 +1,6 @@ +#ifndef STATUS_BATTSTAT_H +#define STATUS_BATTSTAT_H + +int mod_battstatus(char *config, char *name, char *pipename); + +#endif diff --git a/builds/utils/c/status/bspwm.c b/builds/utils/c/status/bspwm.c new file mode 100644 index 0000000..14071c2 --- /dev/null +++ b/builds/utils/c/status/bspwm.c @@ -0,0 +1,142 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bspwm.h" +#include "common.h" + +const char subscribe[] = "subscribe"; + +int get_socket(void) { + struct sockaddr_un sock; + char *host; + int displaynumber, screennumber; + int fd; + + xcb_parse_display(NULL, &host, &displaynumber, &screennumber); + + sock.sun_family = AF_UNIX; + snprintf( + sock.sun_path, + sizeof(sock.sun_path), "/tmp/bspwm%s_%i_%i-socket", + host, displaynumber, screennumber + ); + + free(host); + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect( + fd, + (struct sockaddr *) &sock, + sizeof(sock) + ) == -1) { + return -1; + } else { + return fd; + } +} + +int should_be_shown(char c) { + return c == 'O' || c == 'o' || c == 'F' || c == 'U' || c == 'u'; +} + +int is_a_desktop(char c) { + return c == 'O' || c == 'o' || c == 'F' || c == 'f' || c == 'U' || c == 'u'; +} + +/* XXX: this function has the potential to buffer overflow by ONE BYTE. + * probably fix this? */ +void print_desktop_status(char *in, char *out, int outlen) { + int written; + int i; + char c; + + /* flags */ + int read_colon; + int skip_to_next_colon; + int read_until_colon; + int is_first_desktop; + int last_was_desktop; + + i = 0; + written = 0; + read_colon = 1; + skip_to_next_colon = 0; + read_until_colon = 0; + is_first_desktop = 1; + last_was_desktop = 0; + + for(;;) { + c = in[i]; + + if(!c) break; + if(written == outlen) break; + + if (skip_to_next_colon) { + if (c == ':') { + skip_to_next_colon = 0; + read_until_colon = 0; + read_colon = 1; + } else if (read_until_colon) { + out[written] = c; + written++; + } + } else if (read_colon && should_be_shown(c)) { + if (!is_first_desktop) { + out[written] = ' '; + written++; + } + + switch(c) { + case 'O': + case 'F': /* fallthrough */ + out[written] = '*'; + written++; + break; + } + + skip_to_next_colon = 1; + read_until_colon = 1; + read_colon = 0; + is_first_desktop = 0; + last_was_desktop = 1; + } else if (read_colon && is_a_desktop(c)) { + last_was_desktop = 1; + } else { + if(last_was_desktop) { + break; + } + } + i++; + } + + out[written] = '\0'; +} + +int mod_bspwm(char *config, char *name, char *pipename) { + struct message msg; + int fd, bspcfd; + char in[BUFFER_SIZE]; + + strcpy(msg.name, name); + msg.flags = 0; + + fd = open(pipename, O_WRONLY); + bspcfd = get_socket(); + + send(bspcfd, subscribe, sizeof(subscribe), 0); + + for(;;) { + int recvd = recv(bspcfd, in, BUFFER_SIZE, 0); + print_desktop_status(in, msg.content, 512); + write(fd, &msg, sizeof(msg)); + memset(msg.content, 0, 512); + } + + return 0; +} diff --git a/builds/utils/c/status/bspwm.h b/builds/utils/c/status/bspwm.h new file mode 100644 index 0000000..cd4df4e --- /dev/null +++ b/builds/utils/c/status/bspwm.h @@ -0,0 +1,6 @@ +#ifndef STATUS_BSPWM_H +#define STATUS_BSPWM_H + +int mod_bspwm(char *config, char *name, char *pipename); + +#endif diff --git a/builds/utils/c/status/common.h b/builds/utils/c/status/common.h new file mode 100644 index 0000000..48af44c --- /dev/null +++ b/builds/utils/c/status/common.h @@ -0,0 +1,21 @@ +#ifndef STATUS_COMMON_H +#define STATUS_COMMON_H + +#define LENGTH(x) sizeof(x) / sizeof(x[0]) +#define BUFFER_SIZE 512 + +struct module { + int (*fork_callback)(char *config, char *name, char *pipename); + char name[16]; + char config[512]; + char buffer[512]; + int buflen; +}; + +struct message { + int flags; + char name[16]; + char content[512]; +}; + +#endif diff --git a/builds/utils/c/status/main.c b/builds/utils/c/status/main.c new file mode 100644 index 0000000..3c10160 --- /dev/null +++ b/builds/utils/c/status/main.c @@ -0,0 +1,91 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "common.h" +#include "battery.h" +#include "battstatus.h" +#include "bspwm.h" +#include "time.h" + +struct module mods[] = { + {mod_battery, "battery", "BAT0", { '\0' }}, + {mod_battstatus, "battstatus", "BAT0", { '\0' }}, + {mod_time, "time", "", { '\0' }}, +/* {mod_bspwm, "bspwm", "", { '\0' }}, not working at the moment */ +}; + +void create_module_proc(int index, char *pipename) { + pid_t pid = fork(); + + if (pid == 0) { /* we're the child */ + mods[index].fork_callback( + mods[index].config, + mods[index].name, + pipename + ); + } +} + +void create_module_procs(char *pipename) { + for(int i = 0; i < LENGTH(mods); i++) { + create_module_proc(i, pipename); + } +} + +void redraw() { + /* get the progress' module's value, convert it to int, and then + * figure out how much of the screen should be shaded in */ + + printf("\033[H\033[2J"); + for(int i = 0; i < LENGTH(mods); i++) { + if (i == 0) printf("%s ", mods[i].buffer); + else printf("| %s ", mods[i].buffer); + } + + fflush(stdout); +} + +static char NAMED_PIPE[] = "/home/usr/.cache/statusbar_pipe"; + +int main(void) { + char pipename[BUFFER_SIZE]; + srand(time(NULL)); + strcpy(pipename, &NAMED_PIPE); + pipename[sizeof(NAMED_PIPE) - 1] = 'A' + (rand() % 26); + pipename[sizeof(NAMED_PIPE)] = 'A' + (rand() % 26); + pipename[sizeof(NAMED_PIPE) + 1] = '\0'; + mkfifo(pipename, 0666); + int fd = open(pipename, O_RDWR); + struct message msg; + + create_module_procs(pipename); + + for (;;) { + int ret = read(fd, &msg, sizeof(msg)); + if(ret < 0) { + printf("error while reading message from child\n"); + } + + for(int i = 0; i < LENGTH(mods); i++) { + if(strcmp(mods[i].name, msg.name) == 0) { + mods[i].buflen = strlen(msg.content); + strcpy(mods[i].buffer, msg.content); + redraw(); + break; + } + } + } + + return 0; +} diff --git a/builds/utils/c/status/shell.nix b/builds/utils/c/status/shell.nix new file mode 100644 index 0000000..b0645c3 --- /dev/null +++ b/builds/utils/c/status/shell.nix @@ -0,0 +1,9 @@ +with import {}; + pkgs.mkShell { + nativeBuildInputs = [ + gdb + gnumake + pkg-config + xorg.libxcb + ]; + } diff --git a/builds/utils/c/status/time.c b/builds/utils/c/status/time.c new file mode 100644 index 0000000..b8a81ec --- /dev/null +++ b/builds/utils/c/status/time.c @@ -0,0 +1,27 @@ +#include +#include +#include +#include + +#include "common.h" +#include "time.h" + +int mod_time(char *config, char *name, char *pipename) { + struct message msg; + time_t now; + struct tm *tm; + int fd; + + strcpy(msg.name, name); + msg.flags = 0; + fd = open(pipename, O_WRONLY); + + for(;;) { + time(&now); + tm = localtime(&now); + strftime(msg.content, 512, "%H:%M", tm); + write(fd, &msg, sizeof(msg)); + + sleep(60); + } +} diff --git a/builds/utils/c/status/time.h b/builds/utils/c/status/time.h new file mode 100644 index 0000000..ca7463a --- /dev/null +++ b/builds/utils/c/status/time.h @@ -0,0 +1,6 @@ +#ifndef STATUS_TIME_H +#define STATUS_TIME_H + +int mod_time(char *config, char *name, char *pipename); + +#endif diff --git a/builds/utils/sh/capture b/builds/utils/sh/capture index b251669..e74e052 100755 --- a/builds/utils/sh/capture +++ b/builds/utils/sh/capture @@ -1,7 +1,7 @@ #!/bin/sh # get screen info and temporary file -tmp=$(mktemp) +tmp=$(mktemp -d) res=$(xrandr | grep ' connected' | awk -F' ' '{print $1 " " $4}' | @@ -11,7 +11,7 @@ res=$(xrandr | # still or motion medium=$(printf ".mp4\n.png\n" | fzy) -output="$tmp$medium" +output="$tmp/main$medium" # capture case "$medium" in diff --git a/builds/utils/sh/disp b/builds/utils/sh/disp index f6eb3a1..32411e0 100755 --- a/builds/utils/sh/disp +++ b/builds/utils/sh/disp @@ -1,24 +1,62 @@ #!/bin/sh +find_card_pci() { + [ -z $pci_path ] && pci_path=$(find /sys/devices | \ + grep edid | \ + cut -d/ -f1-6 + ) +} + +assert_edid() { + find_card_pci + + out=$(sha256sum ${pci_path}/card0/card0-$1/edid | \ + cut -d' ' -f1) + + [ "$out" = "$2" ] && return 0 || return 1 +} + exists() { xrandr | grep ' connected' | grep -c "${1}" } -if [ ! "$(hostname)" = "mainsail" ]; then - bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9 -fi - -if [ "$(exists "DP-1")" -gt 1 ]; then - printf "two" - bspc monitor DP-1 -s eDP-1 - xrandr --output eDP-1 --off - exit 0 -fi - -if [ "$(hostname)" = "mainsail" ]; then - # this is a tower, so there's only one configuration - printf "mainsail detected\n" - xrandr --output VGA-1 --left-of HDMI-1 - bspc monitor VGA-1 -d 1 3 5 7 9 - bspc monitor HDMI-1 -d 2 4 6 8 0 -fi +case "$(hostname)" in + "mainsail") + echo "mainsail" + xrandr --output VGA-1 --left-of HDMI-1 + bspc monitor VGA-1 -d 1 3 5 7 9 + bspc monitor HDMI-1 -d 2 4 6 8 0 + ;; + "x230t") + echo "x230t" + case "$1" in + "dockedtwo") + # assume we're connected to the two external displays + xrandr --output VGA-1 --primary --mode 1920x1080 --rotate normal \ + --output HDMI-1 --mode 1920x1080 --rotate normal --right-of VGA-1 \ + --output LVDS-1 --off + bspc monitor VGA-1 -d 1 3 5 7 9 + bspc monitor HDMI-1 -d 2 4 6 8 + ;; + *) + if + assert_edid "VGA-1" "35737dc483d2c3b1b20ea2343ce13c6c42d115febdc9634f8437e1b9f7fd3f5c" && + assert_edid "HDMI-A-1" "01887cbd23d74201e489a6334656f7db73a7b7f732a738a9f1ee2d53389f7817"; + then + echo "docked" + xrandr --output LVDS-1 --primary --mode 1366x768 --pos 1194x1080 --rotate normal \ + --output VGA-1 --mode 1920x1080 --pos 0x0 --rotate normal \ + --output HDMI-1 --mode 1920x1080 --pos 1920x0 --rotate normal \ + --output DP-1 --off \ + --output HDMI-2 --off \ + --output DP-2 --off + bspc monitor LVDS-1 -d 1 4 7 + bspc monitor VGA-1 -d 2 5 8 + bspc monitor HDMI-1 -d 3 6 9 + else + bspc monitor LVDS-1 -d 1 2 3 4 5 6 7 8 9 + fi + ;; + esac + ;; +esac diff --git a/builds/utils/sh/mode b/builds/utils/sh/mode index 86973d2..ff5c3ff 100755 --- a/builds/utils/sh/mode +++ b/builds/utils/sh/mode @@ -1,4 +1,13 @@ # mode - change the current effective sxhkd configuration -pkill sxhkd -sxhkd -c ~/.config/sxhkd/$1 & disown +if [ -n "$1" ]; then + pkill sxhkd + sxhkd -c ~/.config/sxhkd/$1 & disown + [ -f "~/.config/sxhkd/$1.sh ] && ~/.config/sxhkd/$1.sh + + exit +fi + +# we need a menu +choice=$(ls ~/.config/sxhkd | tmenu) +$0 $choice diff --git a/builds/utils/sh/statuswrap b/builds/utils/sh/statuswrap new file mode 100755 index 0000000..e75379c --- /dev/null +++ b/builds/utils/sh/statuswrap @@ -0,0 +1,14 @@ +#!/bin/sh + +geos=$( + xrandr | \ + grep ' connected' | \ + grep -o '[0-9]*x[0-9]*+[0-9]*+[0-9]*' | \ + awk -F'[x+]' '{print $1 "x20+" $3 "+" $4}' +) + +pkill statusbar + +for i in $geos; do + st -c statusbar -p -g "$i" -e statusbar & disown +done diff --git a/builds/utils/sh/wallpaper b/builds/utils/sh/wallpaper deleted file mode 100755 index 2b519eb..0000000 --- a/builds/utils/sh/wallpaper +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -WALLDIR="${HOME}/.local/share/wallpapers" -BASECMD="feh --no-fehbg --bg-fill" - -generate_wall () { - GENWALL=$( \ - ls "$WALLDIR" | \ - grep "." | \ - shuf -n 1 - ) - GENWALL="${WALLDIR}/${GENWALL}" -} -wall () { - generate_wall - while [ "${GENWALL}" = "${1}" ]; do - generate_wall - done -} -displays () { - displays=$(xrandr | grep -c ' connected') -} - -cmd="" -displays -for i in $(seq 1 "$displays"); do - wall "${tmp}" - tmp="${GENWALL}" - cmd="${cmd} ${GENWALL}" -done -eval "${BASECMD}" "${cmd}" -exit 0 diff --git a/common/desktop.nix b/common/desktop.nix deleted file mode 100644 index 9004469..0000000 --- a/common/desktop.nix +++ /dev/null @@ -1,265 +0,0 @@ -{ lib, config, pkgs, ...}: - -let - home-manager = builtins.fetchTarball { - url = "https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz"; - sha256 = "1caggh7q5674b24ghx5p8l4jmd22afwrqqj2flfvlh3n6p94wfyc"; - }; - customPolybar = pkgs.polybar.override { - alsaSupport = true; - pulseSupport = true; - }; -in { - imports = [ - "${builtins.fetchTarball "https://github.com/Mic92/sops-nix/archive/master.tar.gz"}/modules/sops" - (import "${home-manager}/nixos") - ./main.nix - ]; - - services.xserver = { - enable = true; - libinput.enable = true; - layout = "us"; - - displayManager.sx.enable = true; - }; - - sound.enable = true; - hardware.pulseaudio.enable = true; - - nixpkgs.config = { - allowUnfree = true; - permittedInsecurePackages = [ - "libxls-1.6.2" - ]; - }; - - environment.systemPackages = with pkgs; [ - sx - fzy - xclip - xcape - ffmpeg - man-pages - - ncmpcpp - pciutils - tor-browser-bundle-bin - xscreensaver - ncpamixer - gpick - calcurse - dunst - libnotify - tig - neomutt - mpv - yt-dlp - zathura - tmux - lynx - feh - elinks - sc-im - ledger - remind - python3 - pinentry-curses - magic-wormhole - xbrightness - xdotool - figlet - neomutt - - unzip - lua-language-server - rnix-lsp - python311Packages.jedi-language-server - - ungoogled-chromium - discord - - customPolybar - (pkgs.callPackage ../builds/utils.nix {}) - (pkgs.callPackage ../builds/st.nix {}) - (pkgs.callPackage ../builds/pash.nix {}) - ]; - - fonts.fonts = with pkgs; [ - fantasque-sans-mono - ]; - - programs.gnupg.agent = { - enable = true; - pinentryFlavor = "gtk2"; - enableSSHSupport = true; - }; - - programs.firefox = { - enable = true; - policies = { - DisableFirefoxStudies = true; - DisablePocket = true; - DisableTelemetry = { - Cryptomining = true; - Fingerprinting = true; - EmailTracking = true; - }; - DisableFirefoxAccounts = true; - DisableFirefoxScreenshots = true; - DisableSetDesktopBackground = true; - DisplayBookmarksToolbar = "never"; - DontCheckDefaultBrowser = true; - Extensions = { - Install = [ - "https://addons.mozilla.org/firefox/downloads/file/3812704/umatrix-1.4.4.xpi" - "https://addons.mozilla.org/firefox/downloads/file/3824639/gruvbox_true_dark-2.0.xpi" - "https://addons.mozilla.org/firefox/downloads/file/4128489/darkreader-4.9.64.xpi" - "https://addons.mozilla.org/firefox/downloads/file/4036604/tridactyl_vim-1.23.0.xpi" - "https://addons.mozilla.org/firefox/downloads/file/4098688/user_agent_string_switcher-0.5.0.xpi" - ]; - }; - FirefoxHome = { - Pocket = false; - Snippets = false; - TopSites = false; - SponsoredTopSites = false; - }; - UserMessaging = { - ExtensionRecommendations = false; - SkipOnboarding = true; - MoreFromMozilla = false; - UrlbarInterventions = false; - WhatsNew = false; - }; - EnableTrackingProtection = true; - OverrideFirstRunPage = ""; - OverridePostUpdatePage = ""; - PasswordManagerEnabled = false; - SearchSuggestEnabled = false; - }; - nativeMessagingHosts.packages = [ - pkgs.tridactyl-native - ]; - }; - - services.mpd = { - enable = true; - musicDirectory = "/home/usr/music"; - user = "usr"; - extraConfig = '' - audio_output { - type "pulse" - name "Pulseaudio" - } - audio_output { - type "alsa" - name "mpd alsamixer-output" - } - ''; - }; - - users.users.usr = { - isNormalUser = true; - extraGroups = [ "wheel" ]; - initialPassword = "usr"; - packages = with pkgs; [ - firefox - tree - bspwm - sxhkd - ]; - }; - - - # honking impure, but who's counting anyway? - system.activationScripts.test-script.text = '' - #!${pkgs.bash}/bin/bash - - if [ "$(${pkgs.coreutils}/bin/whoami)" = "usr"]; then - ${pkgs.coreutils}/bin/mkdir -p /home/usr/git - ${pkgs.git}/bin/git https://git.beepboop.systems/rndusr/dot /home/usr/git/dot - ${pkgs.git}/bin/git https://git.beepboop.systems/rndusr/privdata /home/usr/git/privdata - fi - ''; - - home-manager.users.usr = { - home.stateVersion = "23.05"; - - programs.neovim = { - enable = true; - extraLuaPackages = luaPkgs: with luaPkgs; [ luaexpat ]; - extraPackages = [ pkgs.sqlite ]; - }; - - home.file = { - ".config/bash" = { - source = ../config/bash; - recursive = true; - }; - ".config/bspwm" = { - source = ../config/bspwm; - recursive = true; - }; - ".config/git" = { - source = ../config/git; - recursive = true; - }; - ".config/htop" = { - source = ../config/htop; - recursive = true; - }; - ".config/nvim" = { - source = ../config/nvim; - recursive = true; - }; - ".config/python" = { - source = ../config/python; - recursive = true; - }; - ".config/polybar" = { - source = ../config/polybar; - recursive = true; - }; - ".config/sx" = { - source = ../config/sx; - recursive = true; - }; - ".config/sxhkd" = { - source = ../config/sxhkd; - recursive = true; - }; - ".config/tridactyl" = { - source = ../config/tridactyl; - recursive = true; - }; - ".config/zathura" = { - source = ../config/zathura; - recursive = true; - }; - ".local/share/wallpapers" = { - source = ../wallpapers; - recursive = true; - }; - ".local/share/gnupg" = { - source = ../config/gnupg; - recursive = true; - }; - ".config/emacs" = { - source = ../config/emacs; - recursive = true; - }; - }; - }; - - environment.etc = { - "profile.local" = { - text = "source /home/usr/.config/bash/profile"; - }; - "bashrc.local" = { - text = "source /home/usr/.config/bash/bashrc"; - }; - }; - - programs.ssh.askPassword = ""; -} diff --git a/common/gaming.nix b/common/gaming.nix deleted file mode 100644 index a8c25bb..0000000 --- a/common/gaming.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - environment.systemPackages = with pkgs; [ - steam-run - prismlauncher - xonotic - minetest - ]; -} diff --git a/common/main.nix b/common/main.nix deleted file mode 100644 index 4f22544..0000000 --- a/common/main.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ lib, config, pkgs, ... }: - -let -my_neovim = pkgs.neovim.overrideAttrs (oldAttrs: { - buildInputs = oldAttrs.buildInputs or [] ++ [ pkgs.luajitPackages.luaexpat ]; -}); -in { - imports = - [ - ../hardware-configuration.nix # include the results of the hardware scan - ]; - - networking.networkmanager.enable = true; - - time.timeZone = "America/Chicago"; - - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "us"; - }; - - environment.systemPackages = with pkgs; [ - curl - htop - git - tree - dig - htop - gnumake - - (pkgs.callPackage ../builds/rebuild.nix {}) - ]; - - system.copySystemConfiguration = true; - system.stateVersion = "23.05"; # don't change this, lol -} diff --git a/demo.png b/demo.png new file mode 100644 index 0000000..6ee7e09 Binary files /dev/null and b/demo.png differ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d53acea --- /dev/null +++ b/flake.lock @@ -0,0 +1,239 @@ +{ + "nodes": { + "blobs": { + "flake": false, + "locked": { + "lastModified": 1604995301, + "narHash": "sha256-wcLzgLec6SGJA8fx1OEN1yV/Py5b+U5iyYpksUY/yLw=", + "owner": "simple-nixos-mailserver", + "repo": "blobs", + "rev": "2cccdf1ca48316f2cfd1c9a0017e8de5a7156265", + "type": "gitlab" + }, + "original": { + "owner": "simple-nixos-mailserver", + "repo": "blobs", + "type": "gitlab" + } + }, + "firefox-addons": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "dir": "pkgs/firefox-addons", + "lastModified": 1705709716, + "narHash": "sha256-YJdWSN3ra0FsAQT5PXe7uXxMeAXxTR+SY/wVOO1c6Bs=", + "owner": "rycee", + "repo": "nur-expressions", + "rev": "d7ad3362283fced58410547650be31e37f9d0f41", + "type": "gitlab" + }, + "original": { + "dir": "pkgs/firefox-addons", + "owner": "rycee", + "repo": "nur-expressions", + "type": "gitlab" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1629284811, + "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1705659542, + "narHash": "sha256-WA3xVfAk1AYmFdwghT7mt/erYpsU6JPu9mdTEP/e9HQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "10cd9c53115061aa6a0a90aad0b0dde6a999cdb9", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-23.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1705641746, + "narHash": "sha256-D6c2aH8HQbWc7ZWSV0BUpFpd94ImFyCP8jFIsKQ4Slg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d2003f2223cbb8cd95134e4a0541beea215c1073", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-22_11": { + "locked": { + "lastModified": 1669558522, + "narHash": "sha256-yqxn+wOiPqe6cxzOo4leeJOp1bXE/fjPEi/3F/bBHv8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ce5fe99df1f15a09a91a86be9738d68fadfbad82", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-22.11", + "type": "indirect" + } + }, + "nixpkgs-23_05": { + "locked": { + "lastModified": 1684782344, + "narHash": "sha256-SHN8hPYYSX0thDrMLMWPWYulK3YFgASOrCsIL3AJ78g=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8966c43feba2c701ed624302b6a935f97bcbdf88", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.05", + "type": "indirect" + } + }, + "nixpkgs-23_11": { + "locked": { + "lastModified": 1701539137, + "narHash": "sha256-nVO/5QYpf1GwjvtpXhyxx5M3U/WN0MwBro4Lsk+9mL0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "933d7dc155096e7575d207be6fb7792bc9f34f6d", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.11", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1670751203, + "narHash": "sha256-XdoH1v3shKDGlrwjgrNX/EN8s3c+kQV7xY6cLCE8vcI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "64e0bf055f9d25928c31fb12924e59ff8ce71e60", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "firefox-addons": "firefox-addons", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "simple-nixos-mailserver": "simple-nixos-mailserver", + "utilpkg": "utilpkg" + } + }, + "simple-nixos-mailserver": { + "inputs": { + "blobs": "blobs", + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs_2", + "nixpkgs-22_11": "nixpkgs-22_11", + "nixpkgs-23_05": "nixpkgs-23_05", + "nixpkgs-23_11": "nixpkgs-23_11", + "utils": "utils" + }, + "locked": { + "lastModified": 1703023684, + "narHash": "sha256-XQU4OaacV0F2tf9cNAvIMqlC0HBIrAtvb0MLjIHt+7M=", + "owner": "simple-nixos-mailserver", + "repo": "nixos-mailserver", + "rev": "4bfb8eb058f098302c97b909df2d019926e11220", + "type": "gitlab" + }, + "original": { + "owner": "simple-nixos-mailserver", + "ref": "nixos-23.11", + "repo": "nixos-mailserver", + "type": "gitlab" + } + }, + "utilpkg": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-iemuV19UU8TriqixcvwdRUTa8lIrxc3Krwt4bHpUUWE=", + "path": "/nix/store/26f187i54ky8clnmd0rbjvv8h3khgc5d-source/builds", + "type": "path" + }, + "original": { + "path": "/nix/store/26f187i54ky8clnmd0rbjvv8h3khgc5d-source/builds", + "type": "path" + } + }, + "utils": { + "locked": { + "lastModified": 1605370193, + "narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5021eac20303a61fafe17224c087f5519baed54d", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..220cdcd --- /dev/null +++ b/flake.nix @@ -0,0 +1,103 @@ +{ + description = "rndusr's nixos flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + home-manager = { + url = "github:nix-community/home-manager/release-23.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + firefox-addons = { + url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + utilpkg = { + url = "./builds"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + simple-nixos-mailserver = { + url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-23.11"; + }; + }; + + outputs = { self, nixpkgs, home-manager, firefox-addons, simple-nixos-mailserver, utilpkg, ... }@inputs: { + nixosConfigurations = { + netbox = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./boxes/netbox + simple-nixos-mailserver.nixosModule + { + mailserver = { + enable = true; + fqdn = "mail.beepboop.systems"; + domains = [ "beepboop.systems" ]; + loginAccounts = { + "ryan@beepboop.systems" = { + # nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' > /hashed/password/file/location + hashedPasswordFile = "/etc/ryan-beepboop-systemsuser-pass"; + + aliases = [ + "info@beepboop.systems" + "postmaster@beepboop.systems" + ]; + }; + }; + certificateScheme = "acme-nginx"; + }; + } + ]; + }; + mlg = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./boxes/mlg + + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.usr = import ./boxes/mlg/home.nix; + } + ]; + }; + virtbox = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./boxes/virtbox + + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.usr = import ./boxes/virtbox/home.nix; + } + ]; + }; + x230t = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./boxes/x230t + + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.usr = import ./boxes/x230t/home.nix; + } + ]; + }; + mainsail = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./boxes/mainsail + ]; + }; + }; + }; +} diff --git a/config/bash/bashrc b/home/bash/bashrc similarity index 100% rename from config/bash/bashrc rename to home/bash/bashrc diff --git a/home/bash/default.nix b/home/bash/default.nix new file mode 100644 index 0000000..d4e3b5a --- /dev/null +++ b/home/bash/default.nix @@ -0,0 +1,18 @@ +{ lib, config, pkgs, home, ... }: + +{ + # if we use programs.bash.enable, it creates spurious .bashrc and .profile in + # our home directory, which is no good + home.packages = with pkgs; [ + bash + ]; + + home.file = { + ".config/bash/bashrc" = { + source = ./bashrc; + }; + ".config/bash/profile" = { + source = ./profile; + }; + }; +} diff --git a/config/bash/profile b/home/bash/profile similarity index 96% rename from config/bash/profile rename to home/bash/profile index 31a5bd9..306ac61 100644 --- a/config/bash/profile +++ b/home/bash/profile @@ -54,3 +54,6 @@ export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus" # source the bashrc(s) [ -f $HOME/.config/bash/bashrc ] && . $HOME/.config/bash/bashrc [ -f $HOME/.bashrc ] && . $HOME/.bashrc + +# if we're interactive and the tty is /dev/tty1 then start xorg +[ "$(tty)" = "/dev/tty1" ] && sx diff --git a/config/bspwm/bspwmrc b/home/bspwm/bspwmrc similarity index 71% rename from config/bspwm/bspwmrc rename to home/bspwm/bspwmrc index b2b7f18..c285482 100755 --- a/config/bspwm/bspwmrc +++ b/home/bspwm/bspwmrc @@ -1,11 +1,26 @@ #!/bin/sh # rndusr's bspwmrc +bspc rule -a st-gpg-menu state=floating +bspc rule -a statusbar border=off sticky=on state=floating manage=off +bspc rule -a tmenu-prompt border=on sticky=on state=floating +bspc rule -a Xmessage border=on state=floating +bspc rule -a Zathura state=tiled +bspc rule -a generic-st-window state=floating manage=on sticky=on border=on +bspc rule -a floating-feh state=floating + +set_walls() { + for i in $(xrandr | grep ' connected' | cut -d' ' -f1); do + xwallpaper --output $i --zoom ~/.local/share/pape.jpg + done +} + # post-wm boilerplate -wallpaper disp -polybar & -dunst & +statuswrap +set_walls +pkill xscreensaver +HOME=".config/xscreensaver" xscreensaver --no-splash & # set up the color scheme bspc config normal_border_color "#161510" @@ -16,13 +31,5 @@ bspc config pointer_follows_focus true bspc config pointer_follows_monitor true bspc config focus_follows_pointer true -bspc config window_gap 3 -#bspc config top_padding 20 - -bspc rule -a st-gpg-menu state=floating -bspc rule -a statusbar border=off sticky=on state=floating manage=off -bspc rule -a tmenu-prompt border=on sticky=on state=floating -bspc rule -a Xmessage border=on state=floating -bspc rule -a Zathura state=tiled -bspc rule -a generic-st-window state=floating manage=on sticky=on border=on -bspc rule -a floating-feh state=floating +bspc config window_gap 0 +bspc config top_padding 20 diff --git a/home/bspwm/default.nix b/home/bspwm/default.nix new file mode 100644 index 0000000..f471784 --- /dev/null +++ b/home/bspwm/default.nix @@ -0,0 +1,11 @@ +{ lib, config, pkgs, home, ... }: + +{ + # program activation is managed by nixos config + + home.file = { + ".config/bspwm/bspwmrc" = { + source = ./bspwmrc; + }; + }; +} diff --git a/home/chromium/default.nix b/home/chromium/default.nix new file mode 100644 index 0000000..66707b3 --- /dev/null +++ b/home/chromium/default.nix @@ -0,0 +1,15 @@ +{ lib, inputs, config, pkgs, home, ... }: + +{ + home.packages = with pkgs; [ + ungoogled-chromium + ]; + + programs.chromium = { + enable = true; + package = pkgs.ungoogled-chromium; + extensions = [ + { id = "ecnphlgnajanjnkcmbpancdjoidceilk"; } + ]; + }; +} diff --git a/config/earth/assets/all-assets.svg b/home/earth/src/assets/all-assets.svg similarity index 100% rename from config/earth/assets/all-assets.svg rename to home/earth/src/assets/all-assets.svg diff --git a/config/earth/assets/all-assets.txt b/home/earth/src/assets/all-assets.txt similarity index 100% rename from config/earth/assets/all-assets.txt rename to home/earth/src/assets/all-assets.txt diff --git a/config/earth/assets/change_dpi.sh b/home/earth/src/assets/change_dpi.sh similarity index 100% rename from config/earth/assets/change_dpi.sh rename to home/earth/src/assets/change_dpi.sh diff --git a/config/earth/assets/checkbox-checked-insensitive.svg b/home/earth/src/assets/checkbox-checked-insensitive.svg similarity index 100% rename from config/earth/assets/checkbox-checked-insensitive.svg rename to home/earth/src/assets/checkbox-checked-insensitive.svg diff --git a/config/earth/assets/checkbox-checked.svg b/home/earth/src/assets/checkbox-checked.svg similarity index 100% rename from config/earth/assets/checkbox-checked.svg rename to home/earth/src/assets/checkbox-checked.svg diff --git a/config/earth/assets/checkbox-mixed-insensitive.svg b/home/earth/src/assets/checkbox-mixed-insensitive.svg similarity index 100% rename from config/earth/assets/checkbox-mixed-insensitive.svg rename to home/earth/src/assets/checkbox-mixed-insensitive.svg diff --git a/config/earth/assets/checkbox-mixed.svg b/home/earth/src/assets/checkbox-mixed.svg similarity index 100% rename from config/earth/assets/checkbox-mixed.svg rename to home/earth/src/assets/checkbox-mixed.svg diff --git a/config/earth/assets/grid-selection-checked.svg b/home/earth/src/assets/grid-selection-checked.svg similarity index 100% rename from config/earth/assets/grid-selection-checked.svg rename to home/earth/src/assets/grid-selection-checked.svg diff --git a/config/earth/assets/grid-selection-unchecked.svg b/home/earth/src/assets/grid-selection-unchecked.svg similarity index 100% rename from config/earth/assets/grid-selection-unchecked.svg rename to home/earth/src/assets/grid-selection-unchecked.svg diff --git a/config/earth/assets/menuitem-checkbox-checked-hover.svg b/home/earth/src/assets/menuitem-checkbox-checked-hover.svg similarity index 100% rename from config/earth/assets/menuitem-checkbox-checked-hover.svg rename to home/earth/src/assets/menuitem-checkbox-checked-hover.svg diff --git a/config/earth/assets/menuitem-checkbox-checked-insensitive.svg b/home/earth/src/assets/menuitem-checkbox-checked-insensitive.svg similarity index 100% rename from config/earth/assets/menuitem-checkbox-checked-insensitive.svg rename to home/earth/src/assets/menuitem-checkbox-checked-insensitive.svg diff --git a/config/earth/assets/menuitem-checkbox-checked.svg b/home/earth/src/assets/menuitem-checkbox-checked.svg similarity index 100% rename from config/earth/assets/menuitem-checkbox-checked.svg rename to home/earth/src/assets/menuitem-checkbox-checked.svg diff --git a/config/earth/assets/menuitem-checkbox-mixed-hover.svg b/home/earth/src/assets/menuitem-checkbox-mixed-hover.svg similarity index 100% rename from config/earth/assets/menuitem-checkbox-mixed-hover.svg rename to home/earth/src/assets/menuitem-checkbox-mixed-hover.svg diff --git a/config/earth/assets/menuitem-checkbox-mixed-insensitive.svg b/home/earth/src/assets/menuitem-checkbox-mixed-insensitive.svg similarity index 100% rename from config/earth/assets/menuitem-checkbox-mixed-insensitive.svg rename to home/earth/src/assets/menuitem-checkbox-mixed-insensitive.svg diff --git a/config/earth/assets/menuitem-checkbox-mixed-selected.svg b/home/earth/src/assets/menuitem-checkbox-mixed-selected.svg similarity index 100% rename from config/earth/assets/menuitem-checkbox-mixed-selected.svg rename to home/earth/src/assets/menuitem-checkbox-mixed-selected.svg diff --git a/config/earth/assets/menuitem-checkbox-mixed.svg b/home/earth/src/assets/menuitem-checkbox-mixed.svg similarity index 100% rename from config/earth/assets/menuitem-checkbox-mixed.svg rename to home/earth/src/assets/menuitem-checkbox-mixed.svg diff --git a/config/earth/assets/menuitem-checkbox-unchecked.svg b/home/earth/src/assets/menuitem-checkbox-unchecked.svg similarity index 100% rename from config/earth/assets/menuitem-checkbox-unchecked.svg rename to home/earth/src/assets/menuitem-checkbox-unchecked.svg diff --git a/config/earth/assets/menuitem-radio-checked-hover.svg b/home/earth/src/assets/menuitem-radio-checked-hover.svg similarity index 100% rename from config/earth/assets/menuitem-radio-checked-hover.svg rename to home/earth/src/assets/menuitem-radio-checked-hover.svg diff --git a/config/earth/assets/menuitem-radio-checked-insensitive.svg b/home/earth/src/assets/menuitem-radio-checked-insensitive.svg similarity index 100% rename from config/earth/assets/menuitem-radio-checked-insensitive.svg rename to home/earth/src/assets/menuitem-radio-checked-insensitive.svg diff --git a/config/earth/assets/menuitem-radio-checked.svg b/home/earth/src/assets/menuitem-radio-checked.svg similarity index 100% rename from config/earth/assets/menuitem-radio-checked.svg rename to home/earth/src/assets/menuitem-radio-checked.svg diff --git a/config/earth/assets/menuitem-radio-mixed-hover.svg b/home/earth/src/assets/menuitem-radio-mixed-hover.svg similarity index 100% rename from config/earth/assets/menuitem-radio-mixed-hover.svg rename to home/earth/src/assets/menuitem-radio-mixed-hover.svg diff --git a/config/earth/assets/menuitem-radio-mixed-insensitive.svg b/home/earth/src/assets/menuitem-radio-mixed-insensitive.svg similarity index 100% rename from config/earth/assets/menuitem-radio-mixed-insensitive.svg rename to home/earth/src/assets/menuitem-radio-mixed-insensitive.svg diff --git a/config/earth/assets/menuitem-radio-mixed-selected.svg b/home/earth/src/assets/menuitem-radio-mixed-selected.svg similarity index 100% rename from config/earth/assets/menuitem-radio-mixed-selected.svg rename to home/earth/src/assets/menuitem-radio-mixed-selected.svg diff --git a/config/earth/assets/menuitem-radio-mixed.svg b/home/earth/src/assets/menuitem-radio-mixed.svg similarity index 100% rename from config/earth/assets/menuitem-radio-mixed.svg rename to home/earth/src/assets/menuitem-radio-mixed.svg diff --git a/config/earth/assets/menuitem-radio-unchecked.svg b/home/earth/src/assets/menuitem-radio-unchecked.svg similarity index 100% rename from config/earth/assets/menuitem-radio-unchecked.svg rename to home/earth/src/assets/menuitem-radio-unchecked.svg diff --git a/config/earth/assets/pane-handle-vertical.svg b/home/earth/src/assets/pane-handle-vertical.svg similarity index 100% rename from config/earth/assets/pane-handle-vertical.svg rename to home/earth/src/assets/pane-handle-vertical.svg diff --git a/config/earth/assets/pane-handle.png b/home/earth/src/assets/pane-handle.png similarity index 100% rename from config/earth/assets/pane-handle.png rename to home/earth/src/assets/pane-handle.png diff --git a/config/earth/assets/pane-handle.svg b/home/earth/src/assets/pane-handle.svg similarity index 100% rename from config/earth/assets/pane-handle.svg rename to home/earth/src/assets/pane-handle.svg diff --git a/config/earth/assets/pane-handle@2.png b/home/earth/src/assets/pane-handle@2.png similarity index 100% rename from config/earth/assets/pane-handle@2.png rename to home/earth/src/assets/pane-handle@2.png diff --git a/config/earth/assets/radio-checked-insensitive.svg b/home/earth/src/assets/radio-checked-insensitive.svg similarity index 100% rename from config/earth/assets/radio-checked-insensitive.svg rename to home/earth/src/assets/radio-checked-insensitive.svg diff --git a/config/earth/assets/radio-checked.svg b/home/earth/src/assets/radio-checked.svg similarity index 100% rename from config/earth/assets/radio-checked.svg rename to home/earth/src/assets/radio-checked.svg diff --git a/config/earth/assets/radio-mixed-insensitive.svg b/home/earth/src/assets/radio-mixed-insensitive.svg similarity index 100% rename from config/earth/assets/radio-mixed-insensitive.svg rename to home/earth/src/assets/radio-mixed-insensitive.svg diff --git a/config/earth/assets/radio-mixed.svg b/home/earth/src/assets/radio-mixed.svg similarity index 100% rename from config/earth/assets/radio-mixed.svg rename to home/earth/src/assets/radio-mixed.svg diff --git a/config/earth/assets/radio-selected-insensitive.svg b/home/earth/src/assets/radio-selected-insensitive.svg similarity index 100% rename from config/earth/assets/radio-selected-insensitive.svg rename to home/earth/src/assets/radio-selected-insensitive.svg diff --git a/config/earth/assets/radio-selected.svg b/home/earth/src/assets/radio-selected.svg similarity index 100% rename from config/earth/assets/radio-selected.svg rename to home/earth/src/assets/radio-selected.svg diff --git a/config/earth/assets/radio-unselected-insensitive.svg b/home/earth/src/assets/radio-unselected-insensitive.svg similarity index 100% rename from config/earth/assets/radio-unselected-insensitive.svg rename to home/earth/src/assets/radio-unselected-insensitive.svg diff --git a/config/earth/assets/radio-unselected.svg b/home/earth/src/assets/radio-unselected.svg similarity index 100% rename from config/earth/assets/radio-unselected.svg rename to home/earth/src/assets/radio-unselected.svg diff --git a/config/earth/assets/sed.sh b/home/earth/src/assets/sed.sh similarity index 100% rename from config/earth/assets/sed.sh rename to home/earth/src/assets/sed.sh diff --git a/config/earth/assets/unsed.sh b/home/earth/src/assets/unsed.sh similarity index 100% rename from config/earth/assets/unsed.sh rename to home/earth/src/assets/unsed.sh diff --git a/config/earth/gtk-2.0/gtkrc b/home/earth/src/gtk-2.0/gtkrc similarity index 100% rename from config/earth/gtk-2.0/gtkrc rename to home/earth/src/gtk-2.0/gtkrc diff --git a/config/earth/gtk-2.0/gtkrc.hidpi b/home/earth/src/gtk-2.0/gtkrc.hidpi similarity index 100% rename from config/earth/gtk-2.0/gtkrc.hidpi rename to home/earth/src/gtk-2.0/gtkrc.hidpi diff --git a/config/earth/gtk-3.0/assets/all-assets.svg b/home/earth/src/gtk-3.0/assets/all-assets.svg similarity index 100% rename from config/earth/gtk-3.0/assets/all-assets.svg rename to home/earth/src/gtk-3.0/assets/all-assets.svg diff --git a/config/earth/gtk-3.0/assets/all-assets.txt b/home/earth/src/gtk-3.0/assets/all-assets.txt similarity index 100% rename from config/earth/gtk-3.0/assets/all-assets.txt rename to home/earth/src/gtk-3.0/assets/all-assets.txt diff --git a/config/earth/gtk-3.0/assets/change_dpi.sh b/home/earth/src/gtk-3.0/assets/change_dpi.sh similarity index 100% rename from config/earth/gtk-3.0/assets/change_dpi.sh rename to home/earth/src/gtk-3.0/assets/change_dpi.sh diff --git a/config/earth/gtk-3.0/assets/checkbox-checked-dark.svg b/home/earth/src/gtk-3.0/assets/checkbox-checked-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-checked-dark.svg rename to home/earth/src/gtk-3.0/assets/checkbox-checked-dark.svg diff --git a/config/earth/gtk-3.0/assets/checkbox-checked-insensitive-dark.svg b/home/earth/src/gtk-3.0/assets/checkbox-checked-insensitive-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-checked-insensitive-dark.svg rename to home/earth/src/gtk-3.0/assets/checkbox-checked-insensitive-dark.svg diff --git a/config/earth/gtk-3.0/assets/checkbox-checked-insensitive.svg b/home/earth/src/gtk-3.0/assets/checkbox-checked-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-checked-insensitive.svg rename to home/earth/src/gtk-3.0/assets/checkbox-checked-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/checkbox-checked.svg b/home/earth/src/gtk-3.0/assets/checkbox-checked.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-checked.svg rename to home/earth/src/gtk-3.0/assets/checkbox-checked.svg diff --git a/config/earth/gtk-3.0/assets/checkbox-mixed-dark.svg b/home/earth/src/gtk-3.0/assets/checkbox-mixed-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-mixed-dark.svg rename to home/earth/src/gtk-3.0/assets/checkbox-mixed-dark.svg diff --git a/config/earth/gtk-3.0/assets/checkbox-mixed-insensitive-dark.svg b/home/earth/src/gtk-3.0/assets/checkbox-mixed-insensitive-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-mixed-insensitive-dark.svg rename to home/earth/src/gtk-3.0/assets/checkbox-mixed-insensitive-dark.svg diff --git a/config/earth/gtk-3.0/assets/checkbox-mixed-insensitive.svg b/home/earth/src/gtk-3.0/assets/checkbox-mixed-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-mixed-insensitive.svg rename to home/earth/src/gtk-3.0/assets/checkbox-mixed-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/checkbox-mixed.svg b/home/earth/src/gtk-3.0/assets/checkbox-mixed.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-mixed.svg rename to home/earth/src/gtk-3.0/assets/checkbox-mixed.svg diff --git a/config/earth/gtk-3.0/assets/checkbox-unchecked-dark.svg b/home/earth/src/gtk-3.0/assets/checkbox-unchecked-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-unchecked-dark.svg rename to home/earth/src/gtk-3.0/assets/checkbox-unchecked-dark.svg diff --git a/config/earth/gtk-3.0/assets/checkbox-unchecked-insensitive-dark.svg b/home/earth/src/gtk-3.0/assets/checkbox-unchecked-insensitive-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-unchecked-insensitive-dark.svg rename to home/earth/src/gtk-3.0/assets/checkbox-unchecked-insensitive-dark.svg diff --git a/config/earth/gtk-3.0/assets/checkbox-unchecked-insensitive.svg b/home/earth/src/gtk-3.0/assets/checkbox-unchecked-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-unchecked-insensitive.svg rename to home/earth/src/gtk-3.0/assets/checkbox-unchecked-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/checkbox-unchecked.svg b/home/earth/src/gtk-3.0/assets/checkbox-unchecked.svg similarity index 100% rename from config/earth/gtk-3.0/assets/checkbox-unchecked.svg rename to home/earth/src/gtk-3.0/assets/checkbox-unchecked.svg diff --git a/config/earth/gtk-3.0/assets/grid-selection-checked-dark.svg b/home/earth/src/gtk-3.0/assets/grid-selection-checked-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/grid-selection-checked-dark.svg rename to home/earth/src/gtk-3.0/assets/grid-selection-checked-dark.svg diff --git a/config/earth/gtk-3.0/assets/grid-selection-checked.svg b/home/earth/src/gtk-3.0/assets/grid-selection-checked.svg similarity index 100% rename from config/earth/gtk-3.0/assets/grid-selection-checked.svg rename to home/earth/src/gtk-3.0/assets/grid-selection-checked.svg diff --git a/config/earth/gtk-3.0/assets/grid-selection-unchecked-dark.svg b/home/earth/src/gtk-3.0/assets/grid-selection-unchecked-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/grid-selection-unchecked-dark.svg rename to home/earth/src/gtk-3.0/assets/grid-selection-unchecked-dark.svg diff --git a/config/earth/gtk-3.0/assets/grid-selection-unchecked.svg b/home/earth/src/gtk-3.0/assets/grid-selection-unchecked.svg similarity index 100% rename from config/earth/gtk-3.0/assets/grid-selection-unchecked.svg rename to home/earth/src/gtk-3.0/assets/grid-selection-unchecked.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-checkbox-checked-hover.svg b/home/earth/src/gtk-3.0/assets/menuitem-checkbox-checked-hover.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-checkbox-checked-hover.svg rename to home/earth/src/gtk-3.0/assets/menuitem-checkbox-checked-hover.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-checkbox-checked-insensitive.svg b/home/earth/src/gtk-3.0/assets/menuitem-checkbox-checked-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-checkbox-checked-insensitive.svg rename to home/earth/src/gtk-3.0/assets/menuitem-checkbox-checked-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-checkbox-checked.svg b/home/earth/src/gtk-3.0/assets/menuitem-checkbox-checked.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-checkbox-checked.svg rename to home/earth/src/gtk-3.0/assets/menuitem-checkbox-checked.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-checkbox-mixed-hover.svg b/home/earth/src/gtk-3.0/assets/menuitem-checkbox-mixed-hover.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-checkbox-mixed-hover.svg rename to home/earth/src/gtk-3.0/assets/menuitem-checkbox-mixed-hover.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-checkbox-mixed-insensitive.svg b/home/earth/src/gtk-3.0/assets/menuitem-checkbox-mixed-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-checkbox-mixed-insensitive.svg rename to home/earth/src/gtk-3.0/assets/menuitem-checkbox-mixed-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-checkbox-mixed-selected.svg b/home/earth/src/gtk-3.0/assets/menuitem-checkbox-mixed-selected.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-checkbox-mixed-selected.svg rename to home/earth/src/gtk-3.0/assets/menuitem-checkbox-mixed-selected.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-checkbox-mixed.svg b/home/earth/src/gtk-3.0/assets/menuitem-checkbox-mixed.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-checkbox-mixed.svg rename to home/earth/src/gtk-3.0/assets/menuitem-checkbox-mixed.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-checkbox-unchecked.svg b/home/earth/src/gtk-3.0/assets/menuitem-checkbox-unchecked.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-checkbox-unchecked.svg rename to home/earth/src/gtk-3.0/assets/menuitem-checkbox-unchecked.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-radio-checked-hover.svg b/home/earth/src/gtk-3.0/assets/menuitem-radio-checked-hover.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-radio-checked-hover.svg rename to home/earth/src/gtk-3.0/assets/menuitem-radio-checked-hover.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-radio-checked-insensitive.svg b/home/earth/src/gtk-3.0/assets/menuitem-radio-checked-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-radio-checked-insensitive.svg rename to home/earth/src/gtk-3.0/assets/menuitem-radio-checked-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-radio-checked.svg b/home/earth/src/gtk-3.0/assets/menuitem-radio-checked.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-radio-checked.svg rename to home/earth/src/gtk-3.0/assets/menuitem-radio-checked.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-radio-mixed-hover.svg b/home/earth/src/gtk-3.0/assets/menuitem-radio-mixed-hover.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-radio-mixed-hover.svg rename to home/earth/src/gtk-3.0/assets/menuitem-radio-mixed-hover.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-radio-mixed-insensitive.svg b/home/earth/src/gtk-3.0/assets/menuitem-radio-mixed-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-radio-mixed-insensitive.svg rename to home/earth/src/gtk-3.0/assets/menuitem-radio-mixed-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-radio-mixed-selected.svg b/home/earth/src/gtk-3.0/assets/menuitem-radio-mixed-selected.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-radio-mixed-selected.svg rename to home/earth/src/gtk-3.0/assets/menuitem-radio-mixed-selected.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-radio-mixed.svg b/home/earth/src/gtk-3.0/assets/menuitem-radio-mixed.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-radio-mixed.svg rename to home/earth/src/gtk-3.0/assets/menuitem-radio-mixed.svg diff --git a/config/earth/gtk-3.0/assets/menuitem-radio-unchecked.svg b/home/earth/src/gtk-3.0/assets/menuitem-radio-unchecked.svg similarity index 100% rename from config/earth/gtk-3.0/assets/menuitem-radio-unchecked.svg rename to home/earth/src/gtk-3.0/assets/menuitem-radio-unchecked.svg diff --git a/config/earth/gtk-3.0/assets/pane-handle-vertical.svg b/home/earth/src/gtk-3.0/assets/pane-handle-vertical.svg similarity index 100% rename from config/earth/gtk-3.0/assets/pane-handle-vertical.svg rename to home/earth/src/gtk-3.0/assets/pane-handle-vertical.svg diff --git a/config/earth/gtk-3.0/assets/pane-handle.png b/home/earth/src/gtk-3.0/assets/pane-handle.png similarity index 100% rename from config/earth/gtk-3.0/assets/pane-handle.png rename to home/earth/src/gtk-3.0/assets/pane-handle.png diff --git a/config/earth/gtk-3.0/assets/pane-handle.svg b/home/earth/src/gtk-3.0/assets/pane-handle.svg similarity index 100% rename from config/earth/gtk-3.0/assets/pane-handle.svg rename to home/earth/src/gtk-3.0/assets/pane-handle.svg diff --git a/config/earth/gtk-3.0/assets/pane-handle@2.png b/home/earth/src/gtk-3.0/assets/pane-handle@2.png similarity index 100% rename from config/earth/gtk-3.0/assets/pane-handle@2.png rename to home/earth/src/gtk-3.0/assets/pane-handle@2.png diff --git a/config/earth/gtk-3.0/assets/radio-checked-dark.svg b/home/earth/src/gtk-3.0/assets/radio-checked-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-checked-dark.svg rename to home/earth/src/gtk-3.0/assets/radio-checked-dark.svg diff --git a/config/earth/gtk-3.0/assets/radio-checked-insensitive-dark.svg b/home/earth/src/gtk-3.0/assets/radio-checked-insensitive-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-checked-insensitive-dark.svg rename to home/earth/src/gtk-3.0/assets/radio-checked-insensitive-dark.svg diff --git a/config/earth/gtk-3.0/assets/radio-checked-insensitive.svg b/home/earth/src/gtk-3.0/assets/radio-checked-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-checked-insensitive.svg rename to home/earth/src/gtk-3.0/assets/radio-checked-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/radio-checked.svg b/home/earth/src/gtk-3.0/assets/radio-checked.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-checked.svg rename to home/earth/src/gtk-3.0/assets/radio-checked.svg diff --git a/config/earth/gtk-3.0/assets/radio-mixed-dark.svg b/home/earth/src/gtk-3.0/assets/radio-mixed-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-mixed-dark.svg rename to home/earth/src/gtk-3.0/assets/radio-mixed-dark.svg diff --git a/config/earth/gtk-3.0/assets/radio-mixed-insensitive-dark.svg b/home/earth/src/gtk-3.0/assets/radio-mixed-insensitive-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-mixed-insensitive-dark.svg rename to home/earth/src/gtk-3.0/assets/radio-mixed-insensitive-dark.svg diff --git a/config/earth/gtk-3.0/assets/radio-mixed-insensitive.svg b/home/earth/src/gtk-3.0/assets/radio-mixed-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-mixed-insensitive.svg rename to home/earth/src/gtk-3.0/assets/radio-mixed-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/radio-mixed.svg b/home/earth/src/gtk-3.0/assets/radio-mixed.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-mixed.svg rename to home/earth/src/gtk-3.0/assets/radio-mixed.svg diff --git a/config/earth/gtk-3.0/assets/radio-selected-insensitive.svg b/home/earth/src/gtk-3.0/assets/radio-selected-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-selected-insensitive.svg rename to home/earth/src/gtk-3.0/assets/radio-selected-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/radio-selected.svg b/home/earth/src/gtk-3.0/assets/radio-selected.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-selected.svg rename to home/earth/src/gtk-3.0/assets/radio-selected.svg diff --git a/config/earth/gtk-3.0/assets/radio-unchecked-dark.svg b/home/earth/src/gtk-3.0/assets/radio-unchecked-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-unchecked-dark.svg rename to home/earth/src/gtk-3.0/assets/radio-unchecked-dark.svg diff --git a/config/earth/gtk-3.0/assets/radio-unchecked-insensitive-dark.svg b/home/earth/src/gtk-3.0/assets/radio-unchecked-insensitive-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-unchecked-insensitive-dark.svg rename to home/earth/src/gtk-3.0/assets/radio-unchecked-insensitive-dark.svg diff --git a/config/earth/gtk-3.0/assets/radio-unchecked-insensitive.svg b/home/earth/src/gtk-3.0/assets/radio-unchecked-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-unchecked-insensitive.svg rename to home/earth/src/gtk-3.0/assets/radio-unchecked-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/radio-unchecked.svg b/home/earth/src/gtk-3.0/assets/radio-unchecked.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-unchecked.svg rename to home/earth/src/gtk-3.0/assets/radio-unchecked.svg diff --git a/config/earth/gtk-3.0/assets/radio-unselected-dark.svg b/home/earth/src/gtk-3.0/assets/radio-unselected-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-unselected-dark.svg rename to home/earth/src/gtk-3.0/assets/radio-unselected-dark.svg diff --git a/config/earth/gtk-3.0/assets/radio-unselected-insensitive-dark.svg b/home/earth/src/gtk-3.0/assets/radio-unselected-insensitive-dark.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-unselected-insensitive-dark.svg rename to home/earth/src/gtk-3.0/assets/radio-unselected-insensitive-dark.svg diff --git a/config/earth/gtk-3.0/assets/radio-unselected-insensitive.svg b/home/earth/src/gtk-3.0/assets/radio-unselected-insensitive.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-unselected-insensitive.svg rename to home/earth/src/gtk-3.0/assets/radio-unselected-insensitive.svg diff --git a/config/earth/gtk-3.0/assets/radio-unselected.svg b/home/earth/src/gtk-3.0/assets/radio-unselected.svg similarity index 100% rename from config/earth/gtk-3.0/assets/radio-unselected.svg rename to home/earth/src/gtk-3.0/assets/radio-unselected.svg diff --git a/config/earth/gtk-3.0/assets/sed.sh b/home/earth/src/gtk-3.0/assets/sed.sh similarity index 100% rename from config/earth/gtk-3.0/assets/sed.sh rename to home/earth/src/gtk-3.0/assets/sed.sh diff --git a/config/earth/gtk-3.0/assets/unsed.sh b/home/earth/src/gtk-3.0/assets/unsed.sh similarity index 100% rename from config/earth/gtk-3.0/assets/unsed.sh rename to home/earth/src/gtk-3.0/assets/unsed.sh diff --git a/config/earth/gtk-3.0/gtk-dark.css b/home/earth/src/gtk-3.0/gtk-dark.css similarity index 100% rename from config/earth/gtk-3.0/gtk-dark.css rename to home/earth/src/gtk-3.0/gtk-dark.css diff --git a/config/earth/gtk-3.0/gtk.css b/home/earth/src/gtk-3.0/gtk.css similarity index 100% rename from config/earth/gtk-3.0/gtk.css rename to home/earth/src/gtk-3.0/gtk.css diff --git a/config/earth/gtk-3.0/gtk.gresource.xml b/home/earth/src/gtk-3.0/gtk.gresource.xml similarity index 100% rename from config/earth/gtk-3.0/gtk.gresource.xml rename to home/earth/src/gtk-3.0/gtk.gresource.xml diff --git a/config/earth/gtk-3.0/thumbnail.png b/home/earth/src/gtk-3.0/thumbnail.png similarity index 100% rename from config/earth/gtk-3.0/thumbnail.png rename to home/earth/src/gtk-3.0/thumbnail.png diff --git a/config/earth/gtk-3.20/assets b/home/earth/src/gtk-3.20/assets similarity index 100% rename from config/earth/gtk-3.20/assets rename to home/earth/src/gtk-3.20/assets diff --git a/config/earth/gtk-3.20/dist/gtk-dark.css b/home/earth/src/gtk-3.20/dist/gtk-dark.css similarity index 100% rename from config/earth/gtk-3.20/dist/gtk-dark.css rename to home/earth/src/gtk-3.20/dist/gtk-dark.css diff --git a/config/earth/gtk-3.20/dist/gtk.css b/home/earth/src/gtk-3.20/dist/gtk.css similarity index 100% rename from config/earth/gtk-3.20/dist/gtk.css rename to home/earth/src/gtk-3.20/dist/gtk.css diff --git a/config/earth/gtk-3.20/gtk-dark.css b/home/earth/src/gtk-3.20/gtk-dark.css similarity index 100% rename from config/earth/gtk-3.20/gtk-dark.css rename to home/earth/src/gtk-3.20/gtk-dark.css diff --git a/config/earth/gtk-3.20/gtk.css b/home/earth/src/gtk-3.20/gtk.css similarity index 100% rename from config/earth/gtk-3.20/gtk.css rename to home/earth/src/gtk-3.20/gtk.css diff --git a/config/earth/gtk-3.20/gtk.gresource b/home/earth/src/gtk-3.20/gtk.gresource similarity index 100% rename from config/earth/gtk-3.20/gtk.gresource rename to home/earth/src/gtk-3.20/gtk.gresource diff --git a/config/earth/gtk-3.20/gtk.gresource.xml b/home/earth/src/gtk-3.20/gtk.gresource.xml similarity index 100% rename from config/earth/gtk-3.20/gtk.gresource.xml rename to home/earth/src/gtk-3.20/gtk.gresource.xml diff --git a/config/earth/gtk-3.20/thumbnail.png b/home/earth/src/gtk-3.20/thumbnail.png similarity index 100% rename from config/earth/gtk-3.20/thumbnail.png rename to home/earth/src/gtk-3.20/thumbnail.png diff --git a/config/earth/index.theme b/home/earth/src/index.theme similarity index 100% rename from config/earth/index.theme rename to home/earth/src/index.theme diff --git a/config/earth/metacity-1/metacity-theme-2.xml b/home/earth/src/metacity-1/metacity-theme-2.xml similarity index 100% rename from config/earth/metacity-1/metacity-theme-2.xml rename to home/earth/src/metacity-1/metacity-theme-2.xml diff --git a/config/earth/metacity-1/metacity-theme-3.xml b/home/earth/src/metacity-1/metacity-theme-3.xml similarity index 100% rename from config/earth/metacity-1/metacity-theme-3.xml rename to home/earth/src/metacity-1/metacity-theme-3.xml diff --git a/config/earth/metacity-1/thumbnail.png b/home/earth/src/metacity-1/thumbnail.png similarity index 100% rename from config/earth/metacity-1/thumbnail.png rename to home/earth/src/metacity-1/thumbnail.png diff --git a/home/emacs/default.nix b/home/emacs/default.nix new file mode 100644 index 0000000..a97ceb4 --- /dev/null +++ b/home/emacs/default.nix @@ -0,0 +1,11 @@ +{ lib, config, pkgs, home, ... }: + +{ + programs.emacs.enable = true; + + home.file = { + ".config/emacs/init.el" = { + source = ./init.el; + }; + }; +} diff --git a/home/emacs/init.el b/home/emacs/init.el new file mode 100644 index 0000000..856a315 --- /dev/null +++ b/home/emacs/init.el @@ -0,0 +1,168 @@ +;; rndusr's init.el + +;; configure the package manager +(require 'package) +(add-to-list 'package-archives + '("melpa" . "https://melpa.org/packages/")) +(package-initialize) +;; (package-refresh-contents) + +; disable annoying ui features +(menu-bar-mode -1) +(tool-bar-mode -1) +(scroll-bar-mode -1) +(setq auto-save-default nil) +(add-hook 'prog-mode-hook 'display-line-numbers-mode) + +(defun keymap-symbol (keymap) + "Return the symbol to which KEYMAP is bound, or nil if no such symbol exists." + (catch 'gotit + (mapatoms (lambda (sym) + (and (boundp sym) + (eq (symbol-value sym) keymap) + (not (eq sym 'keymap)) + (throw 'gotit sym)))))) + +(defun get-local-map () (interactive) (message "Current mapping: %S" (keymap-symbol (current-local-map)))) + +;; download packages +(unless (package-installed-p 'evil) + (package-install 'evil)) +(unless (package-installed-p 'org) + (package-install 'org)) +(unless (package-installed-p 'org-drill) + (package-install 'org-drill)) +(unless (package-installed-p 'accent) + (package-install 'accent)) +(unless (package-installed-p 'elfeed) + (package-install 'elfeed)) +(unless (package-installed-p 'hackernews) + (package-install 'hackernews)) +(unless (package-installed-p 'emms) + (package-install 'emms)) +(unless (package-installed-p 'company) + (package-install 'company)) +(unless (package-installed-p 'anaconda-mode) + (package-install 'anaconda-mode)) +(unless (package-installed-p 'company-anaconda) + (package-install 'company-anaconda)) +(unless (package-installed-p 'calfw) + (package-install 'calfw)) +(unless (package-installed-p 'calfw-org) + (package-install 'calfw-org)) +(unless (package-installed-p 'calfw-ical) + (package-install 'calfw-ical)) + +;; activate packages +(require 'evil) +(require 'org) +(require 'calfw) +(require 'calfw-org) +(require 'calfw-ical) +(require 'org-drill) +(require 'accent) +(require 'elfeed) +(require 'hackernews) +(require 'emms) +(require 'company) +(require 'anaconda-mode) +(require 'company-anaconda) + +;; configure packages + +;; - evil-mode +(evil-set-initial-state 'elfeed-search 'emacs) + +;; swap ; and : +(with-eval-after-load 'evil-maps + (define-key evil-motion-state-map (kbd ";") 'evil-ex)) + +(evil-set-leader 'normal (kbd "")) +(defun configreload () (interactive) (load "~/.config/emacs/init.el")) +(defun configread () (interactive) (find-file-noselect "~/dot_testing/config/emacs/init.el")) +(defun nixrebuild () (interactive) (term "rebuild")) + +(evil-define-key 'normal 'global (kbd "rr") 'configreload) +(evil-define-key 'normal 'global (kbd "re") 'configread) +(evil-define-key 'normal 'global (kbd "nrr") 'nixrebuild) +(evil-ex-define-cmd "get-current-mapping" 'get-local-map) +(evil-mode 1) + +;; company-mode +(add-hook 'after-init-hook 'global-company-mode) +(setq company-idle-delay 1 + company-tooltip-idle-delay 10 + company-require-match nil + company-frontends + '(company-pseudo-tooltip-unless-just-one-frontend-with-delay + company-preview-frontend + company-echo-metadata-frontend) + company-backends '(company-capf)) +(setq company-tooltip-align-annotations t) +(add-to-list 'company-backends 'company-anaconda) +(add-hook 'python-mode-hook 'anaconda-mode) + +;; org +(setq org-agenda-files '("~/org")) +(setq calendar-week-start-day 1) +(setq org-todo-keywords '((type "MEETING" "CLASS" "TODO" "REHERSAL" "|" "DONE"))) +(setq org-return-follows-link t) + +;; calfw +(defun google-calendar (id) (concatenate 'string "https://calendar.google.com/calendar/ical/" id "%40group.calendar.google.com/public/basic.ics")) + +(defun my-open-calendar () + (interactive) + (cfw:open-calendar-buffer + :contents-sources + (list + (cfw:org-create-source "Green") + (cfw:ical-create-source "wcs" (google-calendar "c_037e243v5md54rj8kp1k898oo4") "IndianRed") + (cfw:ical-create-source "band" (google-calendar "i6bong6iferbcuf1u25jg47t7k") "Blue") + (cfw:ical-create-source "schoology" "https://wcschools.schoology.com/calendar/feed/ical/1692031887/ef3eab3f5ac45935472a9fa6f601a63a/ical.ics" "Yellow") + ))) + +;; emms +(require 'emms-player-simple) +(require 'emms-source-file) +(require 'emms-source-playlist) + +(emms-all) +(emms-default-players) + +(evil-define-key 'normal 'emms-browser-mode-map (kbd "z") 'emms-browser-expand-one-level) +(evil-define-key 'normal 'emms-browser-mode-map (kbd "RET") 'emms-browser-add-tracks-and-play) +(evil-define-key 'normal 'emms-browser-mode-map (kbd "e") 'emms-browser-add-tracks) + +;; - elfeed +(global-set-key (kbd "C-x w") 'elfeed) + +(setq elfeed-feeds + '("http://nullprogram.com/feed/" + "https://drewdevault.com/blog/index.xml" + "https://digitallibrary.un.org/rss?ln=en&p=libya&rg=50&c=Resource%20Type&c=UN%20Bodies" + "https://planet.emacslife.com/atom.xml")) + +(setq elfeed-db-directory "~/.cache/elfeed") + +;; - accent.el +(evil-define-key 'insert 'global (kbd "C-k") 'accent-menu) + +;; fonts +(set-face-attribute 'default nil + :font "Fantasque Sans Mono 10" + :foreground "white" :background "gray8") + +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(package-selected-packages + '(company-anaconda anaconda-mode company emms bongo accent org-drill hackernews evil elfeed))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/home/firefox/default.nix b/home/firefox/default.nix new file mode 100644 index 0000000..f03450c --- /dev/null +++ b/home/firefox/default.nix @@ -0,0 +1,39 @@ +{ lib, inputs, config, pkgs, home, ... }: + +{ + programs.firefox = { + enable = true; + + package = pkgs.firefox.override { + extraPrefs = '' + // automatically enable firefox extensions installed below + lockPref("extensions.autoDisableScopes", 0); + + // enable the gruvbox-dark-theme theme + lockPref("extensions.activeThemeID", "{eb8c4a94-e603-49ef-8e81-73d3c4cc04ff}"); + + // make the interface compact + lockPref("browser.uidensity", 1); + + // make the interface in the correct positions + lockPref( + "browser.uiCustomization.state", + '{"placements":{"widget-overflow-fixed-list":[],"unified-extensions-area":[],"nav-bar":["urlbar-container","back-button","forward-button","stop-reload-button","downloads-button","unified-extensions-button","addon_darkreader_org-browser-action","_aecec67f-0d10-4fa7-b7c7-609a2db280cf_-browser-action","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action","umatrix_raymondhill_net-browser-action"],"toolbar-menubar":["menubar-items"],"TabsToolbar":["firefox-view-button","tabbrowser-tabs","new-tab-button","alltabs-button"],"PersonalToolbar":["import-button","personal-bookmarks"]},"seen":["save-to-pocket-button","addon_darkreader_org-browser-action","umatrix_raymondhill_net-browser-action","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action","_aecec67f-0d10-4fa7-b7c7-609a2db280cf_-browser-action","developer-button"],"dirtyAreaCache":["unified-extensions-area","nav-bar","PersonalToolbar","toolbar-menubar","TabsToolbar"],"currentVersion":20,"newElementCount":4}' + ); + ''; + }; + + profiles = { + main = { + extensions = with inputs.firefox-addons.packages.${pkgs.system}; [ + bitwarden + tridactyl + umatrix + violentmonkey + darkreader + gruvbox-dark-theme + ]; + }; + }; + }; +} diff --git a/config/git/config b/home/git/config similarity index 100% rename from config/git/config rename to home/git/config diff --git a/home/git/default.nix b/home/git/default.nix new file mode 100644 index 0000000..0c99078 --- /dev/null +++ b/home/git/default.nix @@ -0,0 +1,11 @@ +{ lib, config, pkgs, home, ... }: + +{ + # activation managed by nixos config + + home.file = { + ".config/git/config" = { + source = ./config; + }; + }; +} diff --git a/home/gnupg/default.nix b/home/gnupg/default.nix new file mode 100644 index 0000000..bb1aca3 --- /dev/null +++ b/home/gnupg/default.nix @@ -0,0 +1,11 @@ +{ lib, config, pkgs, home, ... }: + +{ + programs.gpg.enable = true; + + home.file = { + ".local/share/gnupg/gpg-agent.conf" = { + source = ./gpg-agent.conf; + }; + }; +} diff --git a/config/gnupg/gpg-agent.conf b/home/gnupg/gpg-agent.conf similarity index 100% rename from config/gnupg/gpg-agent.conf rename to home/gnupg/gpg-agent.conf diff --git a/home/htop/default.nix b/home/htop/default.nix new file mode 100644 index 0000000..c7f73c5 --- /dev/null +++ b/home/htop/default.nix @@ -0,0 +1,11 @@ +{ lib, config, pkgs, home, ... }: + +{ + programs.htop.enable = true; + + home.file = { + ".config/htop/htoprc" = { + source = ./htoprc; + }; + }; +} diff --git a/config/htop/htoprc b/home/htop/htoprc similarity index 100% rename from config/htop/htoprc rename to home/htop/htoprc diff --git a/config/nvim/colors/earth.vim b/home/nvim/colors/earth.vim similarity index 100% rename from config/nvim/colors/earth.vim rename to home/nvim/colors/earth.vim diff --git a/home/nvim/default.nix b/home/nvim/default.nix new file mode 100644 index 0000000..dbf278d --- /dev/null +++ b/home/nvim/default.nix @@ -0,0 +1,14 @@ +{ lib, config, pkgs, home, ... }: + +{ + programs.neovim.enable = true; + + home.file = { + ".config/nvim/init.lua" = { + source = ./init.lua; + }; + ".config/nvim/colors/earth.vim" = { + source = ./colors/earth.vim; + }; + }; +} diff --git a/config/nvim/init.lua b/home/nvim/init.lua similarity index 86% rename from config/nvim/init.lua rename to home/nvim/init.lua index 82fad69..50fff46 100644 --- a/config/nvim/init.lua +++ b/home/nvim/init.lua @@ -80,20 +80,6 @@ globals.vimtex_view_method = 'zathura' -- }}} -- autocommands {{{ --- autocmds for sxhkd and bspwm config files -vim.api.nvim_create_autocmd({"BufWrite"}, { - pattern = {"bspwmrc"}, - callback = function() - vim.fn.system("bspc wm -r") - end -}) -vim.api.nvim_create_autocmd({"BufWrite"}, { - pattern = {"sxhkdrc"}, - callback = function() - vim.fn.system("killall sxhkd -USR1") - end -}) - function setTabbing(lang, width) vim.api.nvim_create_autocmd({"Filetype"}, { pattern = {lang}, @@ -153,19 +139,8 @@ local packer = require('packer').startup(function(use) use 'hrsh7th/nvim-cmp' use 'hrsh7th/cmp-nvim-lsp' use 'L3MON4D3/LuaSnip' - use 'https://github.com/vimwiki/vimwiki.git' use 'lervag/vimtex' use 'https://github.com/protex/better-digraphs.nvim' - use 'https://github.com/itchyny/calendar.vim' - use { - "folke/which-key.nvim", - config = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 --- require("which-key").setup { --- } - end - } if packer_bootstrap then require('packer').sync() diff --git a/config/polybar/config.ini b/home/polybar/config.ini similarity index 100% rename from config/polybar/config.ini rename to home/polybar/config.ini diff --git a/home/polybar/default.nix b/home/polybar/default.nix new file mode 100644 index 0000000..ad5825c --- /dev/null +++ b/home/polybar/default.nix @@ -0,0 +1,10 @@ +{ lib, config, pkgs, home, ... }: + +{ + # activated by nixos configuration + home.file = { + ".config/polybar/config.ini" = { + source = ./config.ini; + }; + }; +} diff --git a/home/python/default.nix b/home/python/default.nix new file mode 100644 index 0000000..935e48e --- /dev/null +++ b/home/python/default.nix @@ -0,0 +1,9 @@ +{ lib, config, pkgs, home, ... }: + +{ + home.file = { + ".config/python/pythonrc" = { + source = ./pythonrc.py; + }; + }; +} diff --git a/config/python/pythonrc.py b/home/python/pythonrc.py similarity index 100% rename from config/python/pythonrc.py rename to home/python/pythonrc.py diff --git a/config/ssh/config b/home/ssh/config similarity index 100% rename from config/ssh/config rename to home/ssh/config diff --git a/home/ssh/default.nix b/home/ssh/default.nix new file mode 100644 index 0000000..a0c1316 --- /dev/null +++ b/home/ssh/default.nix @@ -0,0 +1,11 @@ +{ lib, config, pkgs, home, ... }: + +{ + programs.ssh.enable = true; + + home.file = { + ".ssh/config" = { + source = ./config; + }; + }; +} diff --git a/home/sx/default.nix b/home/sx/default.nix new file mode 100644 index 0000000..e63f893 --- /dev/null +++ b/home/sx/default.nix @@ -0,0 +1,11 @@ +{ lib, config, pkgs, home, ... }: + +{ + # managed by nixos configuration + + home.file = { + ".config/sx/sxrc" = { + source = ./sxrc; + }; + }; +} diff --git a/config/sx/sxrc b/home/sx/sxrc similarity index 100% rename from config/sx/sxrc rename to home/sx/sxrc diff --git a/home/sxhkd/default.nix b/home/sxhkd/default.nix new file mode 100644 index 0000000..61220f5 --- /dev/null +++ b/home/sxhkd/default.nix @@ -0,0 +1,14 @@ +{ lib, config, pkgs, home, ... }: + +{ + # managed by nixos configuration + + home.file = { + ".config/sxhkd/sxhkdrc" = { + source = ./sxhkdrc; + }; + ".config/sxhkd/mouse" = { + source = ./mouse; + }; + }; +} diff --git a/config/sxhkd/mouse b/home/sxhkd/mouse similarity index 100% rename from config/sxhkd/mouse rename to home/sxhkd/mouse diff --git a/config/sxhkd/sxhkdrc b/home/sxhkd/sxhkdrc similarity index 94% rename from config/sxhkd/sxhkdrc rename to home/sxhkd/sxhkdrc index 19b1862..6f0222d 100644 --- a/config/sxhkd/sxhkdrc +++ b/home/sxhkd/sxhkdrc @@ -13,7 +13,7 @@ super + r # reinitialize ancillary services super + w - disp && wallpaper && statusbar && keyboard + disp && keyboard # control the national weather service super + {_,shift + }n diff --git a/home/tridactyl/default.nix b/home/tridactyl/default.nix new file mode 100644 index 0000000..5904299 --- /dev/null +++ b/home/tridactyl/default.nix @@ -0,0 +1,9 @@ +{ lib, config, pkgs, home, ... }: + +{ + home.file = { + ".config/tridactyl/tridactylrc" = { + source = ./tridactylrc; + }; + }; +} diff --git a/config/tridactyl/tridactylrc b/home/tridactyl/tridactylrc similarity index 100% rename from config/tridactyl/tridactylrc rename to home/tridactyl/tridactylrc diff --git a/home/tty-progs.nix b/home/tty-progs.nix new file mode 100644 index 0000000..e69e739 --- /dev/null +++ b/home/tty-progs.nix @@ -0,0 +1,17 @@ +{ lib, config, pkgs, ...}: + +{ + home.packages = with pkgs; [ + cmus # music player + ncpamixer # audio mixer + yt-dlp # youtube downloader + tmux # (t)erminal (mu)ltiple(x)er + elinks # tty web browser + ledger # accounting + neomutt # mail + curl + tree + dig + python3 # nice interactive calculator and shell + ]; +} diff --git a/home/tty.nix b/home/tty.nix new file mode 100644 index 0000000..475edab --- /dev/null +++ b/home/tty.nix @@ -0,0 +1,14 @@ +{ lib, inputs, config, pkgs, home, ... }: + +{ + imports = [ + ./bash + ./git + ./htop + ./nvim + ./python + ./gnupg + + ./tty-progs.nix + ]; +} diff --git a/home/wallpapers/default.nix b/home/wallpapers/default.nix new file mode 100644 index 0000000..5259db2 --- /dev/null +++ b/home/wallpapers/default.nix @@ -0,0 +1,9 @@ +{ lib, config, pkgs, home, ... }: + +{ + home.file = { + ".local/share/pape.jpg" = { + source = ./pape.jpg; + }; + }; +} diff --git a/wallpapers/pape.jpg b/home/wallpapers/pape.jpg similarity index 100% rename from wallpapers/pape.jpg rename to home/wallpapers/pape.jpg diff --git a/home/x11-progs.nix b/home/x11-progs.nix new file mode 100644 index 0000000..82f792b --- /dev/null +++ b/home/x11-progs.nix @@ -0,0 +1,14 @@ +{ lib, config, pkgs, ...}: + +{ + home.packages = with pkgs; [ + xclip + xcape + xscreensaver + mpv + sxiv + xwallpaper + xbrightness + xdotool + ]; +} diff --git a/home/x11.nix b/home/x11.nix new file mode 100644 index 0000000..299f1e3 --- /dev/null +++ b/home/x11.nix @@ -0,0 +1,18 @@ +{ lib, inputs, config, pkgs, home, ... }: + +{ + imports = [ + ./bspwm + ./polybar + ./sx + ./sxhkd + ./tridactyl + ./zathura + ./wallpapers + ./firefox + ./emacs + + ./x11-progs.nix + ./tty.nix + ]; +} diff --git a/home/zathura/default.nix b/home/zathura/default.nix new file mode 100644 index 0000000..43b0557 --- /dev/null +++ b/home/zathura/default.nix @@ -0,0 +1,8 @@ +{ lib, config, pkgs, home, ... }: + +{ + programs.zathura = { + enable = true; + extraConfig = (builtins.readFile ./zathurarc); + }; +} diff --git a/config/zathura/zathurarc b/home/zathura/zathurarc similarity index 100% rename from config/zathura/zathurarc rename to home/zathura/zathurarc diff --git a/modules/adb.nix b/modules/adb.nix new file mode 100644 index 0000000..9680ecc --- /dev/null +++ b/modules/adb.nix @@ -0,0 +1,6 @@ +{ lib, config, pkgs, ...}: + +{ + programs.adb.enable = true; + users.users.usr.extraGroups = [ "adbusers" ]; +} diff --git a/modules/anki.nix b/modules/anki.nix new file mode 100644 index 0000000..3849ea9 --- /dev/null +++ b/modules/anki.nix @@ -0,0 +1,7 @@ +{ lib, config, pkgs, ...}: + +{ + environment.systemPackages = with pkgs; [ + anki-bin + ]; +} diff --git a/modules/bash.nix b/modules/bash.nix new file mode 100644 index 0000000..c774a3a --- /dev/null +++ b/modules/bash.nix @@ -0,0 +1,13 @@ +{ lib, config, pkgs, ...}: + +{ + # make the home-manager .config/bash/(profile/bashrc) work + environment.etc = { + "profile.local" = { + text = "source /home/usr/.config/bash/profile"; + }; + "bashrc.local" = { + text = "source /home/usr/.config/bash/bashrc"; + }; + }; +} diff --git a/modules/bootstrap.nix b/modules/bootstrap.nix new file mode 100644 index 0000000..cdf4b36 --- /dev/null +++ b/modules/bootstrap.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + git + neovim + ]; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; +} diff --git a/modules/common.nix b/modules/common.nix new file mode 100644 index 0000000..8d9f344 --- /dev/null +++ b/modules/common.nix @@ -0,0 +1,31 @@ +{ lib, config, pkgs, inputs, ...}: + +{ + imports = [ + ./bash.nix + ]; + + environment.systemPackages = [ +# is it this? this throws a similar error; no attr st, etc. + inputs.utilpkg.packages.x86_64-linux.st + inputs.utilpkg.packages.x86_64-linux.rebuild + inputs.utilpkg.packages.x86_64-linux.utils + pkgs.man-pages + ]; + + + networking.networkmanager.enable = true; + time.timeZone = "America/Chicago"; + + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + + users.users.usr = { + isNormalUser = true; + extraGroups = [ "wheel" "networkmanager" ]; + initialPassword = "usr"; + }; +} diff --git a/modules/discord.nix b/modules/discord.nix new file mode 100644 index 0000000..bf4cfdd --- /dev/null +++ b/modules/discord.nix @@ -0,0 +1,11 @@ +{ lib, config, pkgs, ...}: + +{ + environment.systemPackages = with pkgs; [ + discord + ]; + + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "discord" + ]; +} diff --git a/modules/fonts.nix b/modules/fonts.nix new file mode 100644 index 0000000..7847549 --- /dev/null +++ b/modules/fonts.nix @@ -0,0 +1,7 @@ +{ lib, config, pkgs, ...}: + +{ + fonts.packages = with pkgs; [ + fantasque-sans-mono + ]; +} diff --git a/common/steam.nix b/modules/gaming.nix similarity index 87% rename from common/steam.nix rename to modules/gaming.nix index 2fd013f..9c5dd7c 100644 --- a/common/steam.nix +++ b/modules/gaming.nix @@ -7,6 +7,8 @@ }; environment.systemPackages = with pkgs; [ - steam-run + prismlauncher + xonotic + minetest ]; } diff --git a/modules/gnupg.nix b/modules/gnupg.nix new file mode 100644 index 0000000..8784ba1 --- /dev/null +++ b/modules/gnupg.nix @@ -0,0 +1,9 @@ +{ lib, config, pkgs, ...}: + +{ + programs.gnupg.agent = { + enable = true; + pinentryFlavor = "gtk2"; + enableSSHSupport = true; + }; +} diff --git a/modules/mail.nix b/modules/mail.nix index af5f33c..f281400 100644 --- a/modules/mail.nix +++ b/modules/mail.nix @@ -35,6 +35,10 @@ in { # nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' > /hashed/password/file/location hashedPasswordFile = "/etc/ryan-beepboop-systemsuser-pass"; }; + "discord9412@beepboop.systems" = { + # nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' > /hashed/password/file/location + hashedPasswordFile = "/etc/ryan-beepboop-systemsuser-pass"; + }; }; certificateScheme = "acme-nginx"; }; diff --git a/modules/media.nix b/modules/media.nix new file mode 100644 index 0000000..8dbdece --- /dev/null +++ b/modules/media.nix @@ -0,0 +1,10 @@ +{ lib, config, pkgs, ...}: + +{ + environment.systemPackages = with pkgs; [ + musescore + audacity + libsForQt5.kdenlive + anki-bin + ]; +} diff --git a/modules/polybar.nix b/modules/polybar.nix new file mode 100644 index 0000000..33bd46f --- /dev/null +++ b/modules/polybar.nix @@ -0,0 +1,12 @@ +{ lib, config, pkgs, ...}: + +let + customPolybar = pkgs.polybar.override { + alsaSupport = true; + pulseSupport = true; + }; +in { + environment.systemPackages = with pkgs; [ + customPolybar + ]; +} diff --git a/modules/power-control.nix b/modules/power-control.nix new file mode 100644 index 0000000..93dbb93 --- /dev/null +++ b/modules/power-control.nix @@ -0,0 +1,25 @@ +{ lib, config, pkgs, inputs, ...}: + +{ + # let regular users control power + security.sudo = { + enable = true; + extraRules = [{ + commands = [ + { + command = "${pkgs.systemd}/bin/systemctl suspend"; + options = [ "NOPASSWD" ]; + } + { + command = "${pkgs.systemd}/bin/reboot"; + options = [ "NOPASSWD" ]; + } + { + command = "${pkgs.systemd}/bin/poweroff"; + options = [ "NOPASSWD" ]; + } + ]; + groups = [ "wheel" ]; + }]; + }; +} diff --git a/modules/pulse.nix b/modules/pulse.nix new file mode 100644 index 0000000..631f21a --- /dev/null +++ b/modules/pulse.nix @@ -0,0 +1,8 @@ +{ lib, config, pkgs, ...}: + +{ + sound.enable = true; + hardware.pulseaudio.enable = true; + + users.extraUsers.usr.extraGroups = [ "audio" ]; +} diff --git a/modules/sxiv.nix b/modules/sxiv.nix new file mode 100644 index 0000000..8d40af1 --- /dev/null +++ b/modules/sxiv.nix @@ -0,0 +1,7 @@ +{ lib, config, pkgs, ...}: + +{ + environment.systemPackages = with pkgs; [ + sxiv + ]; +} diff --git a/modules/tlp.nix b/modules/tlp.nix new file mode 100644 index 0000000..1bb2484 --- /dev/null +++ b/modules/tlp.nix @@ -0,0 +1,5 @@ +{ lib, config, pkgs, inputs, ...}: + +{ + services.tlp.enable = true; +} diff --git a/modules/x11.nix b/modules/x11.nix new file mode 100644 index 0000000..fc4b9cf --- /dev/null +++ b/modules/x11.nix @@ -0,0 +1,24 @@ +{ lib, config, pkgs, ...}: + +{ + imports = [ + ./gnupg.nix + ./fonts.nix + ./pulse.nix + ./sxiv.nix + ]; + + environment.systemPackages = with pkgs; [ + bspwm + sxhkd + xscreensaver + ]; + + services.xserver = { + enable = true; + libinput.enable = true; + layout = "us"; + + displayManager.sx.enable = true; + }; +} diff --git a/nonpure/install.sh b/nonpure/install.sh deleted file mode 100644 index 4242227..0000000 --- a/nonpure/install.sh +++ /dev/null @@ -1,79 +0,0 @@ -if [ "$(id -u)" -eq 1000 ]; then - printf "switch to the root user, and try again.\n" - exit 1 -fi - -lsblk -read -p "Drive name? (/dev/vda): " DRIVE - -ls ../boxes -read -p "NixOS configuration? (virtbox): " NIXOS_CONFIG - -read -p "Reboot? (yes/no, default 'yes'): " REBOOT - -umount -f /mnt/boot -umount -f /mnt -swapoff -a - -nix-env -iA nixos.git - -if [ -z "$DRIVE" ]; then - DRIVE="/dev/vda" -fi - -if [ -z "$NIXOS_CONFIG" ]; then - NIXOS_CONFIG="virtbox" -fi - -if [ -z "$REBOOT" ]; then - REBOOT="yes" -fi - -fdisk "$DRIVE" <