From fd528ff8a4eee23bb12f08a368ca3a48d14e41fe Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 28 Nov 2024 11:09:03 -0500 Subject: [PATCH 01/14] replace `matangover.mypy` with `ms-python.mypy-type-checker` --- home-manager/vscode.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home-manager/vscode.nix b/home-manager/vscode.nix index c15744b..39d66a0 100644 --- a/home-manager/vscode.nix +++ b/home-manager/vscode.nix @@ -51,8 +51,8 @@ ms-python.vscode-pylance ms-python.debugpy ms-python.black-formatter + ms-python.mypy-type-checker charliermarsh.ruff - matangover.mypy # JavaScript / TypeScript dbaeumer.vscode-eslint From 12059b88bd588995581677b466d6cc82fcd8c580 Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 28 Nov 2024 14:41:25 -0500 Subject: [PATCH 02/14] add `go` to the vscode fhs --- home-manager/vscode.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home-manager/vscode.nix b/home-manager/vscode.nix index 39d66a0..fb5007a 100644 --- a/home-manager/vscode.nix +++ b/home-manager/vscode.nix @@ -20,7 +20,7 @@ programs.vscode = { enable = true; package = pkgs.vscode.fhsWithPackages - (ps: with pkgs; [ dotnetCorePackages.sdk_8_0 mypy jdk21 ]); + (ps: with pkgs; [ dotnetCorePackages.sdk_8_0 jdk21 go ]); extensions = with inputs.nix-vscode-extensions.extensions.${system}.vscode-marketplace; with inputs.nix-vscode-extensions.extensions.${system}.vscode-marketplace-release; [ From ade46057a01e658411991c532fef2921061cc484 Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 28 Nov 2024 14:41:39 -0500 Subject: [PATCH 03/14] update lockfile --- flake.lock | 76 +++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/flake.lock b/flake.lock index 79d1829..87f9fac 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "catppuccin": { "locked": { - "lastModified": 1731232837, - "narHash": "sha256-0aIwr/RC/oe7rYkfJb47xjdEQDSNcqpFGsEa+EPlDEs=", + "lastModified": 1732703064, + "narHash": "sha256-n8XOmn0WGtQhAMJKTnhL/3ttV2ZahPRf6gtlqZ6R4QE=", "owner": "catppuccin", "repo": "nix", - "rev": "32359bf226fe874d3b7a0a5753d291a4da9616fe", + "rev": "2e2bdecf0bae287d74947cd5cf967c5c499c23c1", "type": "github" }, "original": { @@ -40,11 +40,11 @@ "onchg": "onchg" }, "locked": { - "lastModified": 1728874779, - "narHash": "sha256-498cQTDaU7bU3CbWPCQgSGkV25T8sZQmMwhU58WkIXE=", + "lastModified": 1732416782, + "narHash": "sha256-evu/J6D79rlQ6oYtKgZxpWvT6ORt0SH573R6IOIS6R0=", "owner": "aksiksi", "repo": "compose2nix", - "rev": "07cad037b8887ba94cd7236ffd1a8ee47002a9fe", + "rev": "a81c2e5e485c722e74dce7c8e308c7b0a1381854", "type": "github" }, "original": { @@ -193,11 +193,11 @@ ] }, "locked": { - "lastModified": 1731363552, - "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=", + "lastModified": 1732021966, + "narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", + "rev": "3308484d1a443fc5bc92012435d79e80458fe43c", "type": "github" }, "original": { @@ -235,11 +235,11 @@ ] }, "locked": { - "lastModified": 1731604581, - "narHash": "sha256-Qq2YZZaDTB3FZLWU/Hgh1uuWlUBl3cMLGB99bm7rFUM=", + "lastModified": 1732793095, + "narHash": "sha256-6TrknJ8CpvSSF4gviQSeD+wyj3siRcMvdBKhOXkEMKU=", "owner": "nix-community", "repo": "home-manager", - "rev": "1d0862ee2d7c6f6cd720d6f32213fa425004be10", + "rev": "2f7739d01080feb4549524e8f6927669b61c6ee3", "type": "github" }, "original": { @@ -257,11 +257,11 @@ ] }, "locked": { - "lastModified": 1731887066, - "narHash": "sha256-uw7K/RsYioJicV79Nl39yjtfhdfTDU2aRxnBgvFhkZ8=", + "lastModified": 1732482255, + "narHash": "sha256-GUffLwzawz5WRVfWaWCg78n/HrBJrOG7QadFY6rtV8A=", "owner": "nix-community", "repo": "home-manager", - "rev": "f3a2ff69586f3a54b461526e5702b1a2f81e740a", + "rev": "a9953635d7f34e7358d5189751110f87e3ac17da", "type": "github" }, "original": { @@ -306,11 +306,11 @@ ] }, "locked": { - "lastModified": 1731885500, - "narHash": "sha256-ZrztYfSOS33J+ewq5alBOSdnIyZ0/sr1iy7FyBe9zIg=", + "lastModified": 1732603785, + "narHash": "sha256-AEjWTJwOmSnVYsSJCojKgoguGfFfwel6z/6ud6UFMU8=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "c60b5c924c6188a0b3ca2e139ead3d0f92ae5db5", + "rev": "6ab87b7c84d4ee873e937108c4ff80c015a40c7a", "type": "github" }, "original": { @@ -364,11 +364,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1731981189, - "narHash": "sha256-EnDFNJq3CuPLZ+3BxGDAqIckbK5pBkUFt3nqLafni4o=", + "lastModified": 1732758864, + "narHash": "sha256-j5UQ6smTs0UaoGG8jTsnsLCyjBp143v7Hrx3Yu6JV1g=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "6f1845dd71ddeb7463856750c5e0cb6c122bb87a", + "rev": "c819590b4790a0a4831f96ebff0443b06f374e57", "type": "github" }, "original": { @@ -411,11 +411,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1731319897, - "narHash": "sha256-PbABj4tnbWFMfBp6OcUK5iGy1QY+/Z96ZcLpooIbuEI=", + "lastModified": 1732521221, + "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dc460ec76cbff0e66e269457d7b728432263166c", + "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", "type": "github" }, "original": { @@ -427,15 +427,15 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1731676054, - "narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=", - "owner": "NixOS", + "lastModified": 1732521221, + "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add", + "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -456,11 +456,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1732035679, - "narHash": "sha256-J03v1XnxvsrrvHmzKVBZiwik8678IXfkH1/ZR954ujk=", + "lastModified": 1732726573, + "narHash": "sha256-gvCPgtcXGf/GZaJBHYrXuM5r2pFRG3VDr7uOb7B1748=", "owner": "nix-community", "repo": "nixvim", - "rev": "929bb0cd1cffb9917ab14be9cdb3f27efd6f505f", + "rev": "fc9178d124eba824f1862513314d351784e1a84c", "type": "github" }, "original": { @@ -565,11 +565,11 @@ ] }, "locked": { - "lastModified": 1731944360, - "narHash": "sha256-sJxPh+V0vUkBhlA58ok/y0o96AtfqiEF0O8qsdolI6o=", + "lastModified": 1732643199, + "narHash": "sha256-uI7TXEb231o8dkwB5AUCecx3AQtosRmL6hKgnckvjps=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "579b9a2fd0020cd9cd81a4ef4eab2dca4d20c94c", + "rev": "84637a7ab04179bdc42aa8fd0af1909fba76ad0c", "type": "github" }, "original": { @@ -583,11 +583,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1731689384, - "narHash": "sha256-L1Aabt+k92BvxH1h/B6SwVwDtglPtQ0yBbSNm3wfUGw=", + "lastModified": 1732785687, + "narHash": "sha256-dkh/Ff2nxZvMdRnkUq+mo8I1IOk/ASjBM7HEanKV290=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "9808c80cb90626f0b3f6a58b36892c44daaf24bd", + "rev": "a1c38bb83c32339b1b0ee6a3f740c0dd677d43be", "type": "github" }, "original": { From b6d72de51bf05c0920c93d2ffedc600d4b369a4e Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 28 Nov 2024 14:43:07 -0500 Subject: [PATCH 04/14] add an .envrc file --- .envrc | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..ef759dc --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +# make this point to wherever your own es25519 ssh key is +SOPS_AGE_KEY=$(ssh-to-age -i ~/.ssh/id_ed25519 -private-key) +export SOPS_AGE_KEY From ed0e65c81f436168b1a47078138e7f0254d06e72 Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 28 Nov 2024 14:43:41 -0500 Subject: [PATCH 05/14] improve `upd` alias and add some other stuff to xonsh configs --- config/xonsh/aliases.py | 66 +++++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/config/xonsh/aliases.py b/config/xonsh/aliases.py index c7e71dd..d8ed841 100644 --- a/config/xonsh/aliases.py +++ b/config/xonsh/aliases.py @@ -1,14 +1,26 @@ from os.path import dirname +from os import environ from pathlib import Path import subprocess +from socket import gethostname import colors -def run(cmd: list[str], cwd: Path = Path.cwd(), **kwargs) -> subprocess.CompletedProcess: +def format_link(link: str, text: str) -> str: + return f"\033]8;;{link}\033\\{text}\033]8;;\033\\" + +def run(cmd: list[str], cwd: Path = Path.cwd(), exit_on_error: bool = True, **kwargs) -> subprocess.CompletedProcess: c = colors.Colors - print(f"{c.GREEN}Running command: {c.RED}'{' '.join(cmd)}'{c.END}") + print(f"{c.GREEN}Running command: {c.PURPLE}'{' '.join(cmd)}'{c.END}") if cwd != Path.cwd(): - print(f"{c.GREEN} 󱞩 in directory: {c.YELLOW}'{cwd}'{c.END}") - return subprocess.run(cmd, cwd=cwd, check=True, **kwargs) + print(f"{c.GREEN} 󱞩 in directory: {c.YELLOW}'{format_link(link="file://" + str(cwd), text=cwd)}'{c.END}") + result = subprocess.run(cmd, cwd=cwd, check=False, **kwargs) + if result.returncode != 0: + print(f"{c.RED}Command exited with non-zero exit code {c.CYAN}{c.BOLD}{result.returncode}{c.END}") + if exit_on_error is True: + result.check_returncode() + else: + print(f"{c.GREEN}Command exited with exit code {c.CYAN}{c.BOLD}{result.returncode}{c.END}") + return result @aliases.register @aliases.return_command @@ -28,19 +40,54 @@ def _vm(args): c = colors.Colors print(f"{c.BLUE}Building virtual machine {c.YELLOW}{vm_name}{c.END}") run(["nixos-rebuild", "build-vm", "-I", "nixos-config=./default.nix", *build_vm_args, "--no-flake"], cwd=vm_path) - print(f"{c.BLUE}Running virtual vachine {c.YELLOW}{vm_name}{c.END}") + print(f"{c.BLUE}Starting virtual vachine {c.YELLOW}{vm_name}{c.END}") run(["./result/bin/run-nixos-vm"], cwd=vm_path) print(f"{c.BLUE}Virtual machine {c.YELLOW}{vm_name} {c.BLUE}has {c.RED}stopped.{c.END}") else: raise FileNotFoundError(f"Virtual machine {vm_name} does not exist.") +@aliases.register +def _upd(args: list): + path = Path("/etc/nixos") + if path.exists(): + c = colors.Colors + print(f"{c.BLUE}Updating {c.YELLOW}NixOS{c.BLUE} hardware configuration file for {c.YELLOW}{gethostname()}{c.BLUE}{c.END}") + run(["sudo", "nixos-generate-config", "--dir", ".",], cwd=path / "hosts") + print(f"{c.BLUE}Deleting redundant {c.YELLOW}NixOS{c.BLUE} configuration file{c.END}") + run(["sudo", "rm", "configuration.nix"], cwd=path / "hosts") + print(f"{c.BLUE}Moving {c.YELLOW}NixOS{c.BLUE} hardware configuration file{c.END}") + run(["sudo", "mv", "hardware-configuration.nix", "{hostname}.nix".format(hostname=gethostname())], cwd=path / "hosts") + print(f"{c.BLUE}Adding {c.YELLOW}NixOS{c.BLUE} hardware configuration file for {c.YELLOW}{gethostname()}{c.BLUE} to git{c.END}") + run(["git", "add", "hosts/{hostname}.nix".format(hostname=gethostname())], cwd=path) + print(f"{c.BLUE}Deleting {c.YELLOW}Visual Studio Code{c.BLUE} user settings backup file{c.END}") + run(["rm", ".config/Code/User/settings.json.bak"], exit_on_error=False, cwd="/home/cswimr") + if "--purge-vscode-extensions" in args: + args.remove("--purge-vscode-extensions") + print(f"{c.BLUE}Killing {c.YELLOW}Visual Studio Code{c.BLUE} processes{c.END}") + run(["killall", "code"]) + print(f"{c.BLUE}Purging {c.YELLOW}Visual Studio Code{c.BLUE} extensions{c.END}") + run(["rm", "-rf", ".vscode/extensions"], cwd="/home/cswimr") + print(f"{c.BLUE}Rebuilding {c.YELLOW}NixOS{c.BLUE} configuration{c.END}") + #TODO: Remove --impure once the Starship module is merged - see ../../nixos/shell.nix for more information + args.append("--impure") + if "--impure" in args: + print(f"{c.RED}WARNING: The --impure flag is set!{c.END}") + run(["sudo", "nixos-rebuild", "switch", *args], cwd=path) + +@aliases.register +def _lock(args): + path = Path("/etc/nixos") + if path.exists(): + c = colors.Colors + print(f"{c.BLUE}Updating {c.YELLOW}Nix Flake{c.BLUE} lock file{c.END}") + run(["nix", "flake", "update", *args], cwd=path) @aliases.register @aliases.return_command def _edit(args): if not args: args = ["."] - if "$SSH_CONNECTION": + if environ.get("SSH_CONNECTION") is not None: return ["$EDITOR", *args] return ["$VISUAL", *args] @@ -71,13 +118,6 @@ alias_dictionary = { "nixpkgs-update": "nix run --option extra-substituters 'https://nix-community.cachix.org/' --option extra-trusted-public-keys 'nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=' github:ryantm/nixpkgs-update --", "nixrc": "edit /etc/nixos", - "upd": '''sudo nixos-generate-config --dir /etc/nixos/hosts and \ - sudo rm /etc/nixos/hosts/configuration.nix and \ - sudo mv /etc/nixos/hosts/hardware-configuration.nix /etc/nixos/hosts/@($HOSTNAME).nix \ - and git -C /etc/nixos --git-dir=/etc/nixos/.git add /etc/nixos/hosts/@($HOSTNAME).nix and \ - rm -rf ~/.config/Code/User/settings.json.bak and \ - sudo nixos-rebuild switch --flake /etc/nixos --impure @($args)''', #TODO: Remove --impure once the Starship module is merged - see ../../nixos/shell.nix for more information - "taildrop": "tailscale file", "forgejo-runner": "act_runner", From 191c334f5fa4bf2ce11e587deb6db534c712276d Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 28 Nov 2024 14:43:49 -0500 Subject: [PATCH 06/14] theme grub with catppuccin --- nixos/catppuccin.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/catppuccin.nix b/nixos/catppuccin.nix index 9828c5f..eb042a7 100644 --- a/nixos/catppuccin.nix +++ b/nixos/catppuccin.nix @@ -1,10 +1,15 @@ { pkgs, ... }: { + # catppuccin for grub + boot.loader.grub.theme = pkgs.catppuccin-grub.override { + flavor = "mocha"; + }; + environment.systemPackages = with pkgs; [ # catppuccin (catppuccin.override { variant = "mocha"; accent ="blue"; - themeList = [ "bat" "btop" "grub" "lazygit" ]; + themeList = [ "bat" "lazygit" ]; }) catppuccin-cursors From b65c466fd621af122d71170d3295b9a1ec8f9247 Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 28 Nov 2024 14:44:07 -0500 Subject: [PATCH 07/14] add `xontrib-clp` --- nixos/shell.nix | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/nixos/shell.nix b/nixos/shell.nix index 3014296..8127f6e 100644 --- a/nixos/shell.nix +++ b/nixos/shell.nix @@ -2,7 +2,8 @@ #TODO: Submit a PR to nixpkgs to add xonsh support to the Starship module # After that, we can remove this import and the disabledModules line disabledModules = [ "programs/starship.nix" ]; - imports = [ /bulk/home/cswimr/Projects/nixpkgs/nixos/modules/programs/starship.nix ]; + imports = + [ /bulk/home/cswimr/Projects/nixpkgs/nixos/modules/programs/starship.nix ]; # starship - a customizable prompt for any shell programs.starship = { @@ -73,12 +74,16 @@ enable = true; config = '' $BASH_COMPLETIONS = ('${bashcfg.completion.package}/etc/profile.d/bash_completion.sh') + $UPDATE_OS_ENVIRON = True + $XONTRIB_CLP_ALIAS = 'shutil' #xontrib load cd + xontrib load clp xontrib load direnv xontrib load sh ''; package = pkgs.xonsh.override { extraPackages = ps: [ + pkgs.python311Packages.rich # (ps.buildPythonPackage rec { # name = "xontrib-cd"; # version = "0.3.1"; @@ -98,6 +103,25 @@ # maintainers = [ "cswimr" ]; # }; # }) + (ps.buildPythonPackage rec { + name = "xontrib-clp"; + version = "0.1.7"; + + src = pkgs.fetchFromGitHub { + owner = "anki-code"; + repo = name; + rev = version; + sha256 = "1ewWlwG8KY9s6qydErurvP2x+4DIPTFcjSGP1c5y83M="; + }; + + meta = { + homepage = "https://github.com/anki-code/xontrib-clp"; + description = + "Copy output to clipboard. Cross-platform."; + license = pkgs.lib.licenses.mit; + maintainers = [ "cswimr" ]; + }; + }) (ps.buildPythonPackage rec { name = "xonsh-direnv"; version = "1.6.5"; From 0d55c755721a5c5510722efa3f15eeee8ec6ad33 Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 28 Nov 2024 14:44:20 -0500 Subject: [PATCH 08/14] add `busybox` and re-add `python311` + some packages --- nixos/pkg.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/pkg.nix b/nixos/pkg.nix index dfc4359..5b5549f 100644 --- a/nixos/pkg.nix +++ b/nixos/pkg.nix @@ -48,6 +48,11 @@ let starship sops ssh-to-age + busybox + + python311 + python311Packages.python-lsp-server + python311Packages.rich ]; flakePackages = with inputs; [ compose2nix.packages.${system}.default ]; in { From d64a4b837ec33869e97f0842ba6afd7782f361c9 Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 28 Nov 2024 22:34:07 -0500 Subject: [PATCH 09/14] switch from `systemd-boot` to `grub` --- nixos/catppuccin.nix | 5 ----- nixos/configuration.nix | 11 ++++++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/nixos/catppuccin.nix b/nixos/catppuccin.nix index eb042a7..59fe4bd 100644 --- a/nixos/catppuccin.nix +++ b/nixos/catppuccin.nix @@ -1,9 +1,4 @@ { pkgs, ... }: { - # catppuccin for grub - boot.loader.grub.theme = pkgs.catppuccin-grub.override { - flavor = "mocha"; - }; - environment.systemPackages = with pkgs; [ # catppuccin (catppuccin.override { diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 9e65892..ee8c985 100755 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -14,7 +14,16 @@ boot.kernelPackages = pkgs.linuxPackages_latest; # Bootloader. - boot.loader.systemd-boot.enable = true; + boot.loader.grub = { + enable = true; + efiSupport = true; + device = "nodev"; + extraEntries = '' + menuentry "Firmware Setup" { + fwsetup + } + ''; + }; boot.loader.efi.canTouchEfiVariables = true; networking.hostName = hostname; # Define your hostname. From 81f147c93841786e9fd6f33e7a0406bee80e2436 Mon Sep 17 00:00:00 2001 From: cswimr Date: Fri, 29 Nov 2024 06:28:00 -0500 Subject: [PATCH 10/14] remove `catppuccin` flake --- flake.lock | 16 ---------------- flake.nix | 17 ----------------- 2 files changed, 33 deletions(-) diff --git a/flake.lock b/flake.lock index 87f9fac..0d8be15 100644 --- a/flake.lock +++ b/flake.lock @@ -1,20 +1,5 @@ { "nodes": { - "catppuccin": { - "locked": { - "lastModified": 1732703064, - "narHash": "sha256-n8XOmn0WGtQhAMJKTnhL/3ttV2ZahPRf6gtlqZ6R4QE=", - "owner": "catppuccin", - "repo": "nix", - "rev": "2e2bdecf0bae287d74947cd5cf967c5c499c23c1", - "type": "github" - }, - "original": { - "owner": "catppuccin", - "repo": "nix", - "type": "github" - } - }, "catppuccin-vsc": { "inputs": { "nixpkgs": "nixpkgs" @@ -516,7 +501,6 @@ }, "root": { "inputs": { - "catppuccin": "catppuccin", "catppuccin-vsc": "catppuccin-vsc", "compose2nix": "compose2nix", "home-manager": "home-manager", diff --git a/flake.nix b/flake.nix index f62bcc0..3ece252 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,6 @@ url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; - catppuccin.url = "github:catppuccin/nix"; compose2nix = { url = "github:aksiksi/compose2nix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -65,16 +64,6 @@ inputs.nixvim.nixosModules.nixvim inputs.nix-flatpak.nixosModules.nix-flatpak - # Catppuccin theme - inputs.catppuccin.nixosModules.catppuccin - { - catppuccin.enable = true; - catppuccin.flavor = "mocha"; - catppuccin.accent = "blue"; - boot.loader.grub.catppuccin.enable = true; - services.displayManager.sddm.catppuccin.enable = false; - } - # Home Manager home-manager.nixosModules.home-manager { @@ -92,12 +81,6 @@ imports = [ ./home-manager/cswimr.nix ./home-manager/vscode.nix - inputs.catppuccin.homeManagerModules.catppuccin - { - catppuccin.enable = true; - catppuccin.flavor = "mocha"; - catppuccin.accent = "blue"; - } ]; }; }; From 6838797fdf3fc8f4b101146c542f4f76fdf0b67d Mon Sep 17 00:00:00 2001 From: cswimr Date: Fri, 29 Nov 2024 06:30:15 -0500 Subject: [PATCH 11/14] add `menu` icon to the firmware setup entry in grub --- assets/img/grub/menu.png | Bin 0 -> 581 bytes nixos/configuration.nix | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 assets/img/grub/menu.png diff --git a/assets/img/grub/menu.png b/assets/img/grub/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..0d6bd0e3c5f34102ddacba0a2a52285ae1454dbf GIT binary patch literal 581 zcmV-L0=oT)P)!J6fu|WYnCNt}neVqzt{mYaPqK^XZO-LSO-=m!ZVEc{& zLO|9)bcuFEJ|CbyvPne7rD-8S<4Cq<8HyLwQ6ykmC&gG9+CxCKLLncpbq1c4LYqZX z);u6&j2G}Z*L;R+6S4V8JdAgtZ&7g$e8S!duu1`IXv`V(b2sdVh&aX?(LM*Ntj+Jw zuhzK?0|l>@;(1*5joL^~iU0*Tc_Gj!K;Lw9M=%6?^5GEm^Pi5i{z61g!g<&j{O2S* z1|RdUSe*5Mei->6qZdfymJ)6Ed3h-1i{UV;Q7DxgQ4D*{wMeA0BQ7Df(NQ4@cpML7 z@CoD|wD)C#D&)_b;uT=h4f3#ooC6&IuVpM_Hj&e|7YK77XfT;to$RYsJ?#Q}^=`!c z)Py81`z~x25TgfXfCRv+@;kttaYqvK#99G(N~$d6N&-Pq{5MqTS1Yz0|2h2zu_1;! TFMzA600000NkvXXu0mjfSMB_? literal 0 HcmV?d00001 diff --git a/nixos/configuration.nix b/nixos/configuration.nix index ee8c985..8f94ce5 100755 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -18,11 +18,15 @@ enable = true; efiSupport = true; device = "nodev"; + theme = pkgs.catppuccin-grub; extraEntries = '' - menuentry "Firmware Setup" { + menuentry "Firmware Setup" --class menu { fwsetup } ''; + extraFiles = { + "theme/icons/menu.png" = "/etc/nixos/assets/img/grub/menu.png"; + }; }; boot.loader.efi.canTouchEfiVariables = true; From 64259596ff58a87d22f6e05b32d3cc4a297af67d Mon Sep 17 00:00:00 2001 From: cswimr Date: Fri, 29 Nov 2024 06:35:15 -0500 Subject: [PATCH 12/14] mypy fixes --- scripts/spectacle-screenshot.py | 10 +++++----- scripts/zipline.py | 12 ++++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/scripts/spectacle-screenshot.py b/scripts/spectacle-screenshot.py index 2a08cad..cc6d1fd 100755 --- a/scripts/spectacle-screenshot.py +++ b/scripts/spectacle-screenshot.py @@ -8,7 +8,7 @@ import tempfile from pathlib import Path from shutil import which -from common.common import notify +from common.common import notify # type: ignore def spectacle_screenshot( @@ -27,7 +27,7 @@ def spectacle_screenshot( use_temp_file = True suffix = ".webm" if record else ".png" temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=suffix) - file_path = temp_file.name + file_path = Path(temp_file.name) temp_file.close() else: use_temp_file = False @@ -48,7 +48,7 @@ def spectacle_screenshot( command.append("--region") try: - subprocess.run(command, check=True) + subprocess.run(command, check=True) # type: ignore except subprocess.CalledProcessError as e: if Path(file_path).exists() and use_temp_file: os.remove(file_path) @@ -69,7 +69,7 @@ def spectacle_screenshot( ] if url: opts.extend(["--url", url]) - subprocess.run(opts) + subprocess.run(opts) # type: ignore finally: if Path(file_path).exists() and use_temp_file: os.remove(file_path) @@ -78,7 +78,7 @@ def spectacle_screenshot( application_name="Spectacle", title="An error occurred", message=str(e), - urgency="critical", + urgency="normal", category="transfer.error", desktop_entry="org.kde.spectacle", ) diff --git a/scripts/zipline.py b/scripts/zipline.py index 8d1e214..b6e0aa3 100755 --- a/scripts/zipline.py +++ b/scripts/zipline.py @@ -9,15 +9,19 @@ from shutil import which from typing import Any import requests # type: ignore -from common.common import does_desktop_entry_exist, notify, read_secret_file +from common.common import ( # type: ignore + does_desktop_entry_exist, + notify, + read_secret_file, +) from pyperclip import copy # type: ignore def zipline( file_path: Path, instance_url: str, - application_name: str = None, - desktop_entry: str = None, + application_name: str | None = None, + desktop_entry: str | None = None, ) -> Any: token = read_secret_file("zipline") @@ -72,7 +76,7 @@ def zipline( application_name=application_name, title="Upload Failed", message=f"An error occurred: {e}", - urgency="critical", + urgency="normal", category="transfer.error", icon=file_path, ) From dc7f0a47862e78025a6a6e82edbac8fcf40143b3 Mon Sep 17 00:00:00 2001 From: cswimr Date: Fri, 29 Nov 2024 06:35:23 -0500 Subject: [PATCH 13/14] init `plasma.nix` --- home-manager/plasma.nix | 79 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 home-manager/plasma.nix diff --git a/home-manager/plasma.nix b/home-manager/plasma.nix new file mode 100644 index 0000000..d2b65e7 --- /dev/null +++ b/home-manager/plasma.nix @@ -0,0 +1,79 @@ +{ + imports = [ ]; + programs.plasma = { + enable = true; + panels = [{ + location = "bottom"; + screen = "all"; + wigets = [ + { + kickoff = { + sortAlphabetically = true; + icon = "nix-snowflake"; + }; + } + { + iconTasks = { + launchers = [ + "applications:zen" + "applications:vesktop" + "applications:steam" + "applications:org.prismlauncher.PrismLauncher" + "applications:code" + "applications:org.kde.konsole" + "applications:org.kde.dolphin" + ]; + }; + } + { + digitalClock = { + calendar.firstDayOfWeek = "sunday"; + time.format = "12h"; + }; + } + ]; + }]; + #TODO: Convert everything below this to use higher level modules + shortcuts = { + "services/net.local.spectacle-screenshot.py-2.desktop"."_launch" = + "Shift+Print"; + "services/net.local.spectacle-screenshot.py.desktop"."_launch" = "Print"; + "services/org.kde.spectacle.desktop"."ActiveWindowScreenShot" = [ ]; + "services/org.kde.spectacle.desktop"."FullScreenScreenShot" = [ ]; + "services/org.kde.spectacle.desktop"."RecordRegion" = [ ]; + "services/org.kde.spectacle.desktop"."RecordScreen" = [ ]; + "services/org.kde.spectacle.desktop"."RecordWindow" = [ ]; + "services/org.kde.spectacle.desktop"."RectangularRegionScreenShot" = [ ]; + "services/org.kde.spectacle.desktop"."WindowUnderCursorScreenShot" = [ ]; + "services/org.kde.spectacle.desktop"."_launch" = [ ]; + }; + configFile = { + "katerc"."KTextEditor Renderer"."Color Theme" = "Catppuccin Mocha"; + "kded5rc"."Module-browserintegrationreminder"."autoload" = false; + "kded5rc"."Module-device_automounter"."autoload" = false; + "kwalletrc"."Wallet"."First Use" = false; + "kwinrc"."Desktops"."Id_1" = "f523b65c-46b8-4c91-94f4-9e247db75777"; + "kwinrc"."Desktops"."Number" = 1; + "kwinrc"."Desktops"."Rows" = 1; + "kwinrc"."Plugins"."sheetEnabled" = true; + "kwinrc"."Plugins"."wobblywindowsEnabled" = true; + "kwinrc"."Plugins"."zoomEnabled" = false; + "kwinrc"."org.kde.kdecoration2"."theme" = "Breeze"; + "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."Description" = + "Application settings for Code"; + "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."clientmachine" = + "localhost"; + "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."desktopfile" = + "/etc/profiles/per-user/cswimr/share/applications/code.desktop"; + "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."desktopfilerule" = + 3; + "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."wmclass" = + "code code-url-handler"; + "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."wmclasscomplete" = + true; + "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."wmclassmatch" = 1; + "kwinrulesrc"."General"."count" = 1; + "kwinrulesrc"."General"."rules" = "700b0164-f5bb-47c9-93fc-2a4587821757"; + }; + }; +} From 2cae64c7610ddc1a192a3ea65ccde50f27cd6366 Mon Sep 17 00:00:00 2001 From: cswimr Date: Fri, 29 Nov 2024 06:35:30 -0500 Subject: [PATCH 14/14] init `.sops.yml` --- .sops.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .sops.yml diff --git a/.sops.yml b/.sops.yml new file mode 100644 index 0000000..11233dc --- /dev/null +++ b/.sops.yml @@ -0,0 +1,7 @@ +keys: + - $eclipse age1q9f9zhkfjn2c3a8qtmfqh0rtls3542jukqpt7t93jca6hc947f3sm9ujhx +creation_rules: + - path_regex: secrets/[^/]+\.(yaml|json|env|ini|sops)$ + key_groups: + - age: + - *eclipse