commit 498f3050d5b0cc6f9e46f44688a4313c74992b2d Author: xunuwu Date: Wed Feb 7 19:05:44 2024 +0100 init diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b40d448 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +root=true + +[*] +charset=utf-8 +end_of_line=lf +indent_size=2 +indent_style=space +insert_final_newline=true +trim_trailing_whitespace=true + +[*.md] +max_line_length=off +trim_trailing_whitespace=false + +[*.{diff,patch}] +end_of_line=unset +indent_size=unset +insert_final_newline=unset +trim_trailing_whitespace=unset diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.sops.yaml b/.sops.yaml new file mode 100644 index 0000000..cced503 --- /dev/null +++ b/.sops.yaml @@ -0,0 +1,12 @@ +keys: + - &users: + - &xun age17pdqkpfh6kc6wm7gxzdnwf6vphlwddv9yfpdu3j76e24y3amd9tq3avfc8 + - &hosts: + - &nixdesk age155sscpw0x36t6s9usdrz7relpxqrtqnk98mrc7s0qcv2n0v3zd7sfl2xn8 + +creation_rules: + - path_regex: secrets/global + key_groups: + - age: + - *xun + - *nixdesk diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..df8c668 --- /dev/null +++ b/flake.lock @@ -0,0 +1,592 @@ +{ + "nodes": { + "firefox-addons": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "dir": "pkgs/firefox-addons", + "lastModified": 1706647585, + "narHash": "sha256-HwAWgXIUn0a2FIS5Mye0sAZj1BZ4++YKWzIPM7coFjs=", + "owner": "rycee", + "repo": "nur-expressions", + "rev": "9343a32ef3fc2d3be2f3c5266a09c63cc5019438", + "type": "gitlab" + }, + "original": { + "dir": "pkgs/firefox-addons", + "owner": "rycee", + "repo": "nur-expressions", + "type": "gitlab" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1706569497, + "narHash": "sha256-oixb0IDb5eZYw6BaVr/R/1pSoMh4rfJHkVnlgeRIeZs=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "60c614008eed1d0383d21daac177a3e036192ed8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "neovim-config", + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704152458, + "narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "88a2cd8166694ba0b6cb374700799cec53aef527", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "neovim-config", + "neovim-nightly-overlay", + "hercules-ci-effects", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1704982712, + "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "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" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "hardware": { + "locked": { + "lastModified": 1706182238, + "narHash": "sha256-Ti7CerGydU7xyrP/ow85lHsOpf+XMx98kQnPoQCSi1g=", + "owner": "nixos", + "repo": "nixos-hardware", + "rev": "f84eaffc35d1a655e84749228cde19922fcf55f1", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixos-hardware", + "type": "github" + } + }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": [ + "neovim-config", + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704029560, + "narHash": "sha256-a4Iu7x1OP+uSYpqadOu8VCPY+MPF3+f6KIi+MAxlgyw=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "d5cbf433a6ae9cae05400189a8dbc6412a03ba16", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1706473109, + "narHash": "sha256-iyuAvpKTsq2u23Cr07RcV5XlfKExrG8gRpF75hf1uVc=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "d634c3abafa454551f2083b054cd95c3f287be61", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "neovim-config": { + "inputs": { + "neovim-nightly-overlay": "neovim-nightly-overlay", + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1706814790, + "narHash": "sha256-loRIH95dJHeuNPxtYHhzaj2vq0uYk76e58thWD3pte8=", + "owner": "xunuwu", + "repo": "neovim-config", + "rev": "96d8f8d57bd2a8478120b2d56706a786ad00df6b", + "type": "github" + }, + "original": { + "owner": "xunuwu", + "repo": "neovim-config", + "type": "github" + } + }, + "neovim-flake": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "neovim-config", + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "dir": "contrib", + "lastModified": 1704559322, + "narHash": "sha256-gB6lTJoAmA/Pf7TkRBETklX3BJexMsW2FPjXfOxRzm0=", + "owner": "neovim", + "repo": "neovim", + "rev": "9a2c98087b90e5306579ab2149a6192ac075df6b", + "type": "github" + }, + "original": { + "dir": "contrib", + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, + "neovim-nightly-overlay": { + "inputs": { + "flake-compat": "flake-compat", + "flake-parts": "flake-parts_2", + "hercules-ci-effects": "hercules-ci-effects", + "neovim-flake": "neovim-flake", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1704585800, + "narHash": "sha256-Qh3WpsNnYHCQTkv33OaQ2RLJtrjytfauhpKly3nruyc=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "915479ceaaed1ddf9379706da575d0d2bf7a48cf", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, + "nix-gaming": { + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1706714349, + "narHash": "sha256-XCWHBWqfCGgP1EY+KWl2xAy1muJN/MTXChiBDbeAb/8=", + "owner": "fufexan", + "repo": "nix-gaming", + "rev": "015aeaa26b7eeafb14ed7e01dce74d1f2338157f", + "type": "github" + }, + "original": { + "owner": "fufexan", + "repo": "nix-gaming", + "type": "github" + } + }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1706411424, + "narHash": "sha256-BzziJYucEZvdCE985vjPoo3ztWcmUiSQ1wJ2CoT6jCc=", + "owner": "Mic92", + "repo": "nix-index-database", + "rev": "c782f2a4f6fc94311ab5ef31df2f1149a1856181", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-index-database", + "type": "github" + } + }, + "nix-vscode-extensions": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1707182119, + "narHash": "sha256-Egt1PmjNAbx2nS0h/iWpaTCcOzLPHpRXzTJBt3waEAs=", + "owner": "nix-community", + "repo": "nix-vscode-extensions", + "rev": "4e7767c214364217e0a7611dca3f3420555ceb20", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-vscode-extensions", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1704161960, + "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "63143ac2c9186be6d9da6035fa22620018c85932", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1703961334, + "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_2": { + "locked": { + "dir": "lib", + "lastModified": 1703961334, + "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1705957679, + "narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9a333eaa80901efe01df07eade2c16d183761fa3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1707092692, + "narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "faf912b086576fd1a15fca610166c98d47bc667e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1706173671, + "narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4fddc9be4eaf195d631333908f2a454b03628ee5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "firefox-addons": "firefox-addons", + "flake-parts": "flake-parts", + "hardware": "hardware", + "home-manager": "home-manager", + "neovim-config": "neovim-config", + "nix-gaming": "nix-gaming", + "nix-index-database": "nix-index-database", + "nix-vscode-extensions": "nix-vscode-extensions", + "nixpkgs": "nixpkgs_3", + "sops-nix": "sops-nix" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": "nixpkgs_4", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1706410821, + "narHash": "sha256-iCfXspqUOPLwRobqQNAQeKzprEyVowLMn17QaRPQc+M=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "73bf36912e31a6b21af6e0f39218e067283c67ef", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "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..febaea5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,72 @@ +{ + outputs = inputs: + inputs.flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86_64-linux"]; + imports = [ + ./home/profiles + ./hosts + ./modules + ]; + flake = { + }; + perSystem = { + config, + pkgs, + ... + }: { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + alejandra + nil + git + home-manager + sops + ]; + name = "dots"; + }; + + formatter = pkgs.alejandra; + }; + }; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + + hardware.url = "github:nixos/nixos-hardware"; + #impermanence.url = "github:nix-community/impermanence"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + neovim-config = { + url = "github:xunuwu/neovim-config"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + firefox-addons = { + url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-gaming = { + url = "github:fufexan/nix-gaming"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + sops-nix.url = "github:Mic92/sops-nix"; + + nix-index-database = { + url = "github:Mic92/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-vscode-extensions = { + url = "github:nix-community/nix-vscode-extensions"; + }; + + #nur.url = "github:nix-community/NUR"; + }; +} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..8337a0e --- /dev/null +++ b/home/default.nix @@ -0,0 +1,23 @@ +{ + lib, + self, + inputs, + ... +}: { + imports = [ + ]; + + home = { + username = "xun"; + homeDirectory = "/home/xun"; + stateVersion = "23.11"; + extraOutputsToInstall = ["doc" "devdoc"]; + }; + + nixpkgs.config = { + allowUnfree = true; + allowUnfreePredicate = _: true; + }; + + programs.home-manager.enable = true; +} diff --git a/home/develop/default.nix b/home/develop/default.nix new file mode 100644 index 0000000..3925d83 --- /dev/null +++ b/home/develop/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./nix.nix + ]; +} diff --git a/home/develop/nix.nix b/home/develop/nix.nix new file mode 100644 index 0000000..3c69534 --- /dev/null +++ b/home/develop/nix.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + nil + alejandra + ]; +} diff --git a/home/editors/emacs.nix b/home/editors/emacs.nix new file mode 100644 index 0000000..6cd9e24 --- /dev/null +++ b/home/editors/emacs.nix @@ -0,0 +1,21 @@ +{pkgs, ...}: { + programs.emacs = { + enable = true; + extraPackages = _: + with pkgs; [ + graphviz # org-roam graph + ]; + }; + + home.packages = with pkgs; [ + cmake + gnumake + gcc + gdb + libtool + ]; + + services.emacs = { + enable = true; + }; +} diff --git a/home/editors/nvim.nix b/home/editors/nvim.nix new file mode 100644 index 0000000..7e9d892 --- /dev/null +++ b/home/editors/nvim.nix @@ -0,0 +1,13 @@ +{ + pkgs, + inputs, + ... +}: { + home.packages = [ + inputs.neovim-config.packages.${pkgs.system}.neovim + ]; + + home.sessionVariables = { + EDITOR = "nvim"; + }; +} diff --git a/home/editors/vscode.nix b/home/editors/vscode.nix new file mode 100644 index 0000000..222126d --- /dev/null +++ b/home/editors/vscode.nix @@ -0,0 +1,32 @@ +{ + pkgs, + inputs, + ... +}: let + exts = inputs.nix-vscode-extensions.extensions.${pkgs.system}; + vsce = exts.vscode-marketplace; + ovsx = exts.open-vsx; +in { + programs.vscode = { + enable = true; + enableUpdateCheck = false; + enableExtensionUpdateCheck = false; + package = pkgs.vscodium; + + mutableExtensionsDir = false; + extensions = [ + ovsx.rust-lang.rust-analyzer + ovsx.llvm-vs-code-extensions.vscode-clangd + ovsx.vadimcn.vscode-lldb + ovsx.mkhl.direnv + ovsx.editorconfig.editorconfig + ovsx.pkief.material-icon-theme + # ovsx.ms-azuretools.vscode-docker + ovsx.eamodio.gitlens + ovsx.jnoortheen.nix-ide + vsce.hediet.debug-visualizer + ovsx.haskell.haskell + ovsx.hoovercj.haskell-linter + ]; + }; +} diff --git a/home/profiles/default.nix b/home/profiles/default.nix new file mode 100644 index 0000000..063dc07 --- /dev/null +++ b/home/profiles/default.nix @@ -0,0 +1,36 @@ +{ + self, + inputs, + ... +}: let + # get these into the module system + extraSpecialArgs = {inherit inputs self;}; + homeImports = { + "xun@nixdesk" = [ + ../. + ./nixdesk + inputs.nix-index-database.hmModules.nix-index + { + programs.nix-index.enableZshIntegration = false; + programs.nix-index.enableBashIntegration = false; + programs.nix-index.enableFishIntegration = false; + } + ]; + }; + + inherit (inputs.home-manager.lib) homeManagerConfiguration; + + pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; +in { + # we need to pass this to NixOS' HM module + _module.args = {inherit homeImports;}; + + flake = { + homeConfigurations = { + "xun@nixdesk" = homeManagerConfiguration { + modules = homeImports."xun@nixdesk"; + inherit pkgs extraSpecialArgs; + }; + }; + }; +} diff --git a/home/profiles/hopper/default.nix b/home/profiles/hopper/default.nix new file mode 100644 index 0000000..115d5f3 --- /dev/null +++ b/home/profiles/hopper/default.nix @@ -0,0 +1,14 @@ +{lib, ...}: { + imports = [ + ../../editors/nvim.nix + ../../terminal/shell/zsh.nix + + ../../programs/media + ../../programs/media/jellyfin.nix + + ../../services/media/playerctl.nix + + ../../services/system/polkit-agent.nix + ../../services/system/udiskie.nix + ]; +} diff --git a/home/profiles/nixdesk/default.nix b/home/profiles/nixdesk/default.nix new file mode 100644 index 0000000..411d0b6 --- /dev/null +++ b/home/profiles/nixdesk/default.nix @@ -0,0 +1,33 @@ +{lib, ...}: { + imports = [ + ../../terminal + ../../editors/nvim.nix + ../../editors/emacs.nix + ../../editors/vscode.nix + ../../programs/browsers/firefox.nix + ../../terminal/emulator/wezterm.nix + + # desktop + ../../programs/desktop/awesome + + # development + ../../develop + + # programs + ../../programs/misc/keepassxc.nix + ../../programs/misc/discord.nix + ../../programs/music + ../../programs/music/yams.nix + ../../programs/media + ../../programs/media/jellyfin.nix + # gaming + ../../programs/games + ../../programs/games/steam.nix + + # media services + ../../services/media/playerctl.nix + # system services + ../../services/system/polkit-agent.nix + ../../services/system/udiskie.nix + ]; +} diff --git a/home/programs/browsers/firefox.nix b/home/programs/browsers/firefox.nix new file mode 100644 index 0000000..fef8b1f --- /dev/null +++ b/home/programs/browsers/firefox.nix @@ -0,0 +1,88 @@ +{ + inputs, + pkgs, + lib, + config, + ... +}: { + programs.firefox = { + enable = true; + profiles.xun = { + extensions = with inputs.firefox-addons.packages.${pkgs.system}; [ + ublock-origin + darkreader + sponsorblock + tridactyl + translate-web-pages + (lib.mkIf (builtins.elem pkgs.keepassxc config.home.packages) keepassxc-browser) + ]; + bookmarks = {}; + settings = { + "browser.newtabpage.enabled" = false; + "browser.newtab.url" = "about:blank"; + + "browser.newtabpage.enhanced" = false; + "browser.newtabpage.introShown" = true; + "browser.newtab.preload" = false; + "browser.newtabpage.directory.ping" = ""; + "browser.newtabpage.directory.source" = "data:text/plain,{}"; + # Reduce search engine noise in the urlbar's completion window. The + # shortcuts and suggestions will still work, but Firefox won't clutter + # its UI with reminders that they exist. + "browser.urlbar.suggest.searches" = false; + "browser.urlbar.shortcuts.bookmarks" = false; + "browser.urlbar.shortcuts.history" = false; + "browser.urlbar.shortcuts.tabs" = false; + "browser.urlbar.showSearchSuggestionsFirst" = false; + "browser.urlbar.speculativeConnect.enabled" = false; + + "browser.download.useDownloadDir" = false; + "signon.rememberSignons" = false; + "browser.shell.checkDefaultBrowser" = false; + # Show whole URL in address bar + "browser.urlbar.trimURLs" = false; + # Disable some not so useful functionality. + "browser.disableResetPrompt" = true; # "Looks like you haven't started Firefox in a while." + "browser.onboarding.enabled" = false; # "New to Firefox? Let's get started!" tour + "browser.aboutConfig.showWarning" = false; # Warning when opening about:config + "media.videocontrols.picture-in-picture.video-toggle.enabled" = false; + "extensions.pocket.enabled" = false; + "extensions.shield-recipe-client.enabled" = false; + #"reader.parse-on-load.enabled" = false; # "reader view" + + # disable telemetry + # https://github.com/hlissner/dotfiles/blob/089f1a9da9018df9e5fc200c2d7bef70f4546026/modules/desktop/browsers/firefox.nix + "toolkit.telemetry.unified" = false; + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.server" = "data:,"; + "toolkit.telemetry.archive.enabled" = false; + "toolkit.telemetry.coverage.opt-out" = true; + "toolkit.coverage.opt-out" = true; + "toolkit.coverage.endpoint.base" = ""; + "experiments.supported" = false; + "experiments.enabled" = false; + "experiments.manifest.uri" = ""; + "browser.ping-centre.telemetry" = false; + "app.normandy.enabled" = false; + "app.normandy.api_url" = ""; + "app.shield.optoutstudies.enabled" = false; + "datareporting.healthreport.uploadEnabled" = false; + "datareporting.healthreport.service.enabled" = false; + "datareporting.policy.dataSubmissionEnabled" = false; + # Disable crash reports + "breakpad.reportURL" = ""; + "browser.tabs.crashReporting.sendReport" = false; + "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; + + # Disable Form autofill + # https://wiki.mozilla.org/Firefox/Features/Form_Autofill + "browser.formfill.enable" = false; + "extensions.formautofill.addresses.enabled" = false; + "extensions.formautofill.available" = "off"; + "extensions.formautofill.creditCards.available" = false; + "extensions.formautofill.creditCards.enabled" = false; + "extensions.formautofill.heuristics.enabled" = false; + }; + }; + }; +} diff --git a/home/programs/desktop/awesome/config/main/error-handling.lua b/home/programs/desktop/awesome/config/main/error-handling.lua new file mode 100644 index 0000000..c92e18d --- /dev/null +++ b/home/programs/desktop/awesome/config/main/error-handling.lua @@ -0,0 +1,30 @@ +-- {{{ Error handling +-- Check if awesome encountered an error during startup and fell back to +-- another config (This code will only ever execute for the fallback config) +if awesome.startup_errors then + naughty.notify({ + preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors, + }) +end + +-- Handle runtime errors after startup +do + local in_error = false + awesome.connect_signal("debug::error", function(err) + -- Make sure we don't go into an endless error loop + if in_error then + return + end + in_error = true + + naughty.notify({ + preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = tostring(err), + }) + in_error = false + end) +end +-- }}} diff --git a/home/programs/desktop/awesome/config/main/layouts.lua b/home/programs/desktop/awesome/config/main/layouts.lua new file mode 100644 index 0000000..314948b --- /dev/null +++ b/home/programs/desktop/awesome/config/main/layouts.lua @@ -0,0 +1,23 @@ +local awful = require('awful') + +-- Table of layouts to cover with awful.layout.inc, order matters. +awful.layout.layouts = { + awful.layout.suit.tile, + awful.layout.suit.fair, + awful.layout.suit.floating, + awful.layout.suit.tile.left, + awful.layout.suit.tile.bottom, + awful.layout.suit.tile.top, + -- awful.layout.suit.fair, + awful.layout.suit.fair.horizontal, + awful.layout.suit.spiral, + awful.layout.suit.spiral.dwindle, + awful.layout.suit.max, + awful.layout.suit.max.fullscreen, + awful.layout.suit.magnifier, + awful.layout.suit.corner.nw, + -- awful.layout.suit.corner.ne, + -- awful.layout.suit.corner.sw, + -- awful.layout.suit.corner.se, +} +-- }}} diff --git a/home/programs/desktop/awesome/config/rc.lua b/home/programs/desktop/awesome/config/rc.lua new file mode 100644 index 0000000..2011d7e --- /dev/null +++ b/home/programs/desktop/awesome/config/rc.lua @@ -0,0 +1,615 @@ +-- If LuaRocks is installed, make sure that packages installed through it are +-- found (e.g. lgi). If LuaRocks is not installed, do nothing. +pcall(require, "luarocks.loader") +-- Standard awesome library +local gears = require("gears") +local awful = require("awful") +require("awful.autofocus") +-- Widget and layout library +local wibox = require("wibox") +-- Theme handling library +local beautiful = require("beautiful") +-- Notification library +local naughty = require("naughty") +local menubar = require("menubar") +local hotkeys_popup = require("awful.hotkeys_popup") +-- Enable hotkeys help widget for VIM and other apps +-- when client with a matching name is opened: + +require("awful.hotkeys_popup.keys") + +require('main.error-handling') + +HOME = os.getenv"HOME" + +-- {{{ Variable definitions +-- Themes define colours, icons, font and wallpapers. +beautiful.init(string.format("%s/.config/awesome/themes/%s/theme.lua", + HOME, + "custom") +) + + +-- This is used later as the default terminal and editor to run. +terminal = "wezterm" +editor = os.getenv("EDITOR") or "nvim" +editor_cmd = terminal .. " -e " .. editor + +-- Default modkey. +-- Usually, Mod4 is the key with a logo between Control and Alt. +-- If you do not like this or do not have such a key, +-- I suggest you to remap Mod4 to another key using xmodmap or other tools. +-- However, you can use another modifier like Mod1, but it may interact with others. +modkey = "Mod4" + +-- load layouts +require('main.layouts') + + +-- {{{ Menu +-- Create a launcher widget and a main menu +myawesomemenu = { + { + "hotkeys", + function() + hotkeys_popup.show_help(nil, awful.screen.focused()) + end, + }, + { "manual", terminal .. " -e man awesome" }, + { "edit config", editor_cmd .. " " .. awesome.conffile }, + { "restart", awesome.restart }, + { + "quit", + function() + awesome.quit() + end, + }, +} + +mymainmenu = awful.menu({ + items = { + { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "open terminal", terminal }, + }, +}) + +-- Menubar configuration +menubar.utils.terminal = terminal -- Set the terminal for applications that require it +-- }}} + +-- {{{ Wibar +-- Create a textclock widget +mytextclock = wibox.widget.textclock(' %a %m-%d %H:%M ', 1) + +-- Create a wibox for each screen and add it +local taglist_buttons = gears.table.join( + awful.button({}, 1, function(t) + t:view_only() + end), + awful.button({ modkey }, 1, function(t) + if client.focus then + client.focus:move_to_tag(t) + end + end), + awful.button({}, 3, awful.tag.viewtoggle), + awful.button({ modkey }, 3, function(t) + if client.focus then + client.focus:toggle_tag(t) + end + end), + awful.button({}, 4, function(t) + awful.tag.viewnext(t.screen) + end), + awful.button({}, 5, function(t) + awful.tag.viewprev(t.screen) + end) +) + +local tasklist_buttons = gears.table.join( + awful.button({}, 1, function(c) + if c == client.focus then + c.minimized = true + else + c:emit_signal("request::activate", "tasklist", { raise = true }) + end + end), + awful.button({}, 3, function() + awful.menu.client_list({ theme = { width = 250 } }) + end), + awful.button({}, 4, function() + awful.client.focus.byidx(1) + end), + awful.button({}, 5, function() + awful.client.focus.byidx(-1) + end) +) + +local function set_wallpaper(s) + -- Wallpaper + if beautiful.wallpaper then + local wallpaper = beautiful.wallpaper + -- If wallpaper is a function, call it with the screen + if type(wallpaper) == "function" then + wallpaper = wallpaper(s) + end + -- gears.wallpaper.maximized(wallpaper, s, true) + gears.wallpaper.maximized(os.getenv("HOME") .. "/Desktop/wallpaperflare.com_wallpaper.jpg", s, true) + end +end + +-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) +screen.connect_signal("property::geometry", set_wallpaper) + +awful.screen.connect_for_each_screen(function(s) + -- Wallpaper + set_wallpaper(s) + + -- Each screen has its own tag table. + awful.tag({ "1", "2", "3", "4", "5" }, s, awful.layout.layouts[1]) + + -- Create a promptbox for each screen + s.mypromptbox = awful.widget.prompt() + -- Create an imagebox widget which will contain an icon indicating which layout we're using. + -- We need one layoutbox per screen. + s.mylayoutbox = awful.widget.layoutbox(s) + s.mylayoutbox:buttons(gears.table.join( + awful.button({}, 1, function() + awful.layout.inc(1) + end), + awful.button({}, 3, function() + awful.layout.inc(-1) + end), + awful.button({}, 4, function() + awful.layout.inc(1) + end), + awful.button({}, 5, function() + awful.layout.inc(-1) + end) + )) + -- Create a taglist widget + s.mytaglist = awful.widget.taglist({ + screen = s, + filter = awful.widget.taglist.filter.all, + buttons = taglist_buttons, + }) + + -- Create a tasklist widget + s.mytasklist = awful.widget.tasklist{ + screen = s, + filter = awful.widget.tasklist.filter.currenttags, + buttons = tasklist_buttons, + } + + -- Create the wibox + s.mywibox = awful.wibar({ position = "top", screen = s }) + + -- Add widgets to the wibox + s.mywibox:setup({ + layout = wibox.layout.align.horizontal, + { -- Left widgets + layout = wibox.layout.fixed.horizontal, + s.mytaglist, + s.mypromptbox, + }, + s.mytasklist, -- Middle widget + { -- Right widgets + layout = wibox.layout.fixed.horizontal, + wibox.widget.systray(), + mytextclock, + s.mylayoutbox, + }, + }) +end) + +-- }}} + +-- {{{ Mouse bindings +root.buttons(gears.table.join( + awful.button({}, 3, function() + mymainmenu:toggle() + end) + --awful.button({}, 4, awful.tag.viewnext), + --awful.button({}, 5, awful.tag.viewprev) +)) +-- }}} + +local function save_screenshot(args) + local ss = awful.screenshot(args) + + local function notify(self) + naughty.notification { + title = self.file_name, + message = "Screenshot saved", + icon = self.surface, + icon_size = 128, + } + end + + if args.auto_save_delay > 0 then + ss:connect_signal("file::saved", notify) + else + notify(ss) + end + + return ss +end + +-- {{{ Key bindings + +globalkeys = gears.table.join( +-- awful.key({}, "Print", function () +-- save_screenshot{ +-- auto_save_delay = 0, +-- screen = awful.screen.focused(), +-- directory = string.format("%s/Pictures/Screenshots", HOME), +-- } +-- end), +-- awful.key({'Control'}, "Print", function () +-- save_screenshot { +-- auto_save_delay = 0, +-- directory = string.format("%s/Pictures/Screenshots", HOME), +-- } +-- end), +-- awful.key({'Shift'}, 'Print', function () +-- save_screenshot { +-- auto_save_delay = 0, +-- interactive = true, +-- directory = string.format("%s/Pictures/Screenshots", HOME), +-- } +-- end), + -- disable ctrl + ; + -- because it for some reason crashes firefox and electron + awful.key({ 'Control' }, ";", function() end), + -- multimedia keys + awful.key({}, "XF86AudioMute", function() awful.spawn('wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle') end), + awful.key({ modkey }, "XF86AudioMute", function() awful.spawn('wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle') end), + awful.key({}, "XF86AudioRaiseVolume", function() awful.spawn('wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 3%+') end), + awful.key({}, "XF86AudioLowerVolume", function() awful.spawn('wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 3%-') end), + --mpris (playerctl) + awful.key({}, "XF86AudioPlay", function() awful.spawn('playerctl play-pause') end), + awful.key({}, "XF86AudioStop", function() awful.spawn('playerctl stop') end), + awful.key({}, "XF86AudioNext", function() awful.spawn('playerctl next') end), + awful.key({}, "XF86AudioPrev", function() awful.spawn('playerctl previous') end), + --mpd (mpc) + awful.key({ modkey }, "XF86AudioPlay", function() awful.spawn('mpc toggle') end), + awful.key({ modkey }, "XF86AudioStop", function() awful.spawn('mpc stop') end), + awful.key({ modkey }, "XF86AudioNext", function() awful.spawn('mpc next') end), + awful.key({ modkey }, "XF86AudioPrev", function() awful.spawn('mpc prev') end), + + awful.key({ modkey }, "s", hotkeys_popup.show_help, { description = "show help", group = "awesome" }), + awful.key({ modkey }, "Left", awful.tag.viewprev, { description = "view previous", group = "tag" }), + awful.key({ modkey }, "Right", awful.tag.viewnext, { description = "view next", group = "tag" }), + awful.key({ modkey }, "Escape", awful.tag.history.restore, { description = "go back", group = "tag" }), + + awful.key({ modkey }, "j", function() + awful.client.focus.byidx(1) + end, { description = "focus next by index", group = "client" }), + awful.key({ modkey }, "k", function() + awful.client.focus.byidx(-1) + end, { description = "focus previous by index", group = "client" }), + awful.key({ modkey }, "w", function() + mymainmenu:show() + end, { description = "show main menu", group = "awesome" }), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function() + awful.client.swap.byidx(1) + end, { description = "swap with next client by index", group = "client" }), + awful.key({ modkey, "Shift" }, "k", function() + awful.client.swap.byidx(-1) + end, { description = "swap with previous client by index", group = "client" }), + awful.key({ modkey, "Control" }, "j", function() + awful.screen.focus_relative(1) + end, { description = "focus the next screen", group = "screen" }), + awful.key({ modkey, "Control" }, "k", function() + awful.screen.focus_relative(-1) + end, { description = "focus the previous screen", group = "screen" }), + awful.key({ modkey }, "u", awful.client.urgent.jumpto, { description = "jump to urgent client", group = "client" }), + awful.key({ modkey }, "Tab", function() + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end, { description = "go back", group = "client" }), + + -- Standard program + awful.key({ modkey }, "Return", function() + awful.spawn(terminal) + end, { description = "open a terminal", group = "launcher" }), + awful.key({ modkey, "Control" }, "r", awesome.restart, { description = "reload awesome", group = "awesome" }), + awful.key({ modkey, "Shift" }, "q", awesome.quit, { description = "quit awesome", group = "awesome" }), + + awful.key({ modkey }, "l", function() + awful.tag.incmwfact(0.05) + end, { description = "increase master width factor", group = "layout" }), + awful.key({ modkey }, "h", function() + awful.tag.incmwfact(-0.05) + end, { description = "decrease master width factor", group = "layout" }), + awful.key({ modkey, "Shift" }, "h", function() + awful.tag.incnmaster(1, nil, true) + end, { description = "increase the number of master clients", group = "layout" }), + awful.key({ modkey, "Shift" }, "l", function() + awful.tag.incnmaster(-1, nil, true) + end, { description = "decrease the number of master clients", group = "layout" }), + awful.key({ modkey, "Control" }, "h", function() + awful.tag.incncol(1, nil, true) + end, { description = "increase the number of columns", group = "layout" }), + awful.key({ modkey, "Control" }, "l", function() + awful.tag.incncol(-1, nil, true) + end, { description = "decrease the number of columns", group = "layout" }), + awful.key({ modkey }, "space", function() + awful.layout.inc(1) + end, { description = "select next", group = "layout" }), + awful.key({ modkey, "Shift" }, "space", function() + awful.layout.inc(-1) + end, { description = "select previous", group = "layout" }), + + awful.key({ modkey, "Control" }, "n", function() + local c = awful.client.restore() + -- Focus restored client + if c then + c:emit_signal("request::activate", "key.unminimize", { raise = true }) + end + end, { description = "restore minimized", group = "client" }), + + -- Prompt + awful.key({ modkey }, "r", function() + awful.screen.focused().mypromptbox:run() + end, { description = "run prompt", group = "launcher" }), + + awful.key({ modkey }, "x", function() + awful.prompt.run({ + prompt = "Run Lua code: ", + textbox = awful.screen.focused().mypromptbox.widget, + exe_callback = awful.util.eval, + history_path = awful.util.get_cache_dir() .. "/history_eval", + }) + end, { description = "lua execute prompt", group = "awesome" }), + -- Menubar + awful.key({ modkey }, "p", function() + menubar.show() + end, { description = "show the menubar", group = "launcher" }) +) + +clientkeys = gears.table.join( + awful.key({ modkey }, "f", function(c) + c.fullscreen = not c.fullscreen + c:raise() + end, { description = "toggle fullscreen", group = "client" }), + awful.key({ modkey }, "q", function(c) + c:kill() + end, { description = "close", group = "client" }), + awful.key( + { modkey, "Control" }, + "space", + awful.client.floating.toggle, + { description = "toggle floating", group = "client" } + ), + awful.key({ modkey, "Control" }, "Return", function(c) + c:swap(awful.client.getmaster()) + end, { description = "move to master", group = "client" }), + awful.key({ modkey }, "o", function(c) + c:move_to_screen() + end, { description = "move to screen", group = "client" }), + awful.key({ modkey }, "t", function(c) + c.ontop = not c.ontop + end, { description = "toggle keep on top", group = "client" }), + awful.key({ modkey }, "n", function(c) + -- The client currently has the input focus, so it cannot be + -- minimized, since minimized clients can't have the focus. + c.minimized = true + end, { description = "minimize", group = "client" }), + awful.key({ modkey }, "m", function(c) + c.maximized = not c.maximized + c:raise() + end, { description = "(un)maximize", group = "client" }), + awful.key({ modkey, "Control" }, "m", function(c) + c.maximized_vertical = not c.maximized_vertical + c:raise() + end, { description = "(un)maximize vertically", group = "client" }), + awful.key({ modkey, "Shift" }, "m", function(c) + c.maximized_horizontal = not c.maximized_horizontal + c:raise() + end, { description = "(un)maximize horizontally", group = "client" }) +) + +-- Bind all key numbers to tags. +-- Be careful: we use keycodes to make it work on any keyboard layout. +-- This should map on the top row of your keyboard, usually 1 to 9. +for i = 1, 9 do + globalkeys = gears.table.join( + globalkeys, + -- View tag only. + awful.key({ modkey }, "#" .. i + 9, function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + tag:view_only() + end + end, { description = "view tag #" .. i, group = "tag" }), + -- Toggle tag display. + awful.key({ modkey, "Control" }, "#" .. i + 9, function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + awful.tag.viewtoggle(tag) + end + end, { description = "toggle tag #" .. i, group = "tag" }), + -- Move client to tag. + awful.key({ modkey, "Shift" }, "#" .. i + 9, function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:move_to_tag(tag) + end + end + end, { description = "move focused client to tag #" .. i, group = "tag" }), + -- Toggle tag on focused client. + awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:toggle_tag(tag) + end + end + end, { description = "toggle focused client on tag #" .. i, group = "tag" }) + ) +end + +clientbuttons = gears.table.join( + awful.button({}, 1, function(c) + c:emit_signal("request::activate", "mouse_click", { raise = true }) + end), + awful.button({ modkey }, 1, function(c) + c:emit_signal("request::activate", "mouse_click", { raise = true }) + awful.mouse.client.move(c) + end), + awful.button({ modkey }, 3, function(c) + c:emit_signal("request::activate", "mouse_click", { raise = true }) + awful.mouse.client.resize(c) + end) +) + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Rules +-- Rules to apply to new clients (through the "manage" signal). +awful.rules.rules = { + -- All clients will match this rule. + { + rule = {}, + properties = { + border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + raise = true, + keys = clientkeys, + buttons = clientbuttons, + screen = awful.screen.preferred, + placement = awful.placement.no_overlap + awful.placement.no_offscreen, + }, + }, + + -- Floating clients. + { + rule_any = { + instance = { + "DTA", -- Firefox addon DownThemAll. + "copyq", -- Includes session name in class. + "pinentry", + }, + class = { + "Arandr", + "Blueman-manager", + "Gpick", + "Kruler", + "MessageWin", -- kalarm. + "Sxiv", + "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. + "Wpa_gui", + "veromix", + "xtightvncviewer", + }, + + -- Note that the name property shown in xprop might be set slightly after creation of the client + -- and the name shown there might not match defined rules here. + name = { + "Event Tester", -- xev. + }, + role = { + "AlarmWindow", -- Thunderbird's calendar. + "ConfigManager", -- Thunderbird's about:config. + "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. + }, + }, + properties = { floating = true }, + }, + + -- Add titlebars to normal clients and dialogs + --{ rule_any = { type = { "normal", "dialog" } }, properties = { titlebars_enabled = true } }, + + -- Set Firefox to always map on the tag named "2" on screen 1. + -- { rule = { class = "Firefox" }, + -- properties = { screen = 1, tag = "2" } }, + { + rule = { + name = "Steam Input On-screen Keyboard", + }, + properties = { + focus = false + }, + }, +} +-- }}} + +-- {{{ Signals +-- Signal function to execute when a new client appears. +client.connect_signal("manage", function(c) + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- if not awesome.startup then awful.client.setslave(c) end + + if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then + -- Prevent clients from being unreachable after screen count changes. + awful.placement.no_offscreen(c) + end +end) + +-- Add a titlebar if titlebars_enabled is set to true in the rules. +client.connect_signal("request::titlebars", function(c) + -- buttons for the titlebar + local buttons = gears.table.join( + awful.button({}, 1, function() + c:emit_signal("request::activate", "titlebar", { raise = true }) + awful.mouse.client.move(c) + end), + awful.button({}, 3, function() + c:emit_signal("request::activate", "titlebar", { raise = true }) + awful.mouse.client.resize(c) + end) + ) + + awful.titlebar(c):setup({ + { -- Left + awful.titlebar.widget.iconwidget(c), + buttons = buttons, + layout = wibox.layout.fixed.horizontal, + }, + { -- Middle + { -- Title + align = "center", + widget = awful.titlebar.widget.titlewidget(c), + }, + buttons = buttons, + layout = wibox.layout.flex.horizontal, + }, + { -- Right + awful.titlebar.widget.floatingbutton(c), + awful.titlebar.widget.maximizedbutton(c), + awful.titlebar.widget.stickybutton(c), + awful.titlebar.widget.ontopbutton(c), + awful.titlebar.widget.closebutton(c), + layout = wibox.layout.fixed.horizontal(), + }, + layout = wibox.layout.align.horizontal, + }) +end) + +-- Enable sloppy focus, so that focus follows mouse. +client.connect_signal("mouse::enter", function(c) + c:emit_signal("request::activate", "mouse_enter", { raise = false }) +end) + +client.connect_signal("focus", function(c) + c.border_color = beautiful.border_focus +end) +client.connect_signal("unfocus", function(c) + c.border_color = beautiful.border_normal +end) +-- }}} + + +require('scripts.autorun') +awful.spawn.once('bash -c '.. gears.filesystem.get_configuration_dir() .. '/scripts/autorun.sh') diff --git a/home/programs/desktop/awesome/config/scripts/autorun.lua b/home/programs/desktop/awesome/config/scripts/autorun.lua new file mode 100644 index 0000000..7b9a1b8 --- /dev/null +++ b/home/programs/desktop/awesome/config/scripts/autorun.lua @@ -0,0 +1,5 @@ +local naughty = require('naughty') +local gears = require('gears') +local awful = require('awful') + +--naughty.notification({ text="hi" }) diff --git a/home/programs/desktop/awesome/config/scripts/autorun.sh b/home/programs/desktop/awesome/config/scripts/autorun.sh new file mode 100755 index 0000000..1dbdddb --- /dev/null +++ b/home/programs/desktop/awesome/config/scripts/autorun.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +xrandr --output DisplayPort-2 --mode 1920x1080 --rate 165 & +/nix/store/$(ls -la /nix/store | grep polkit-gnome | grep '^d' | awk '{print $9}')/libexec/polkit-gnome-authentication-agent-1 & diff --git a/home/programs/desktop/awesome/config/themes/custom/theme.lua b/home/programs/desktop/awesome/config/themes/custom/theme.lua new file mode 100644 index 0000000..d769d89 --- /dev/null +++ b/home/programs/desktop/awesome/config/themes/custom/theme.lua @@ -0,0 +1,64 @@ +local theme_assets = require'beautiful.theme_assets' +local xresources = require'beautiful.xresources' +local dpi = xresources.apply_dpi + +local gfs = require'gears.filesystem' + +local theme = {} + +theme.font = 'sans 8' + +theme.bg_normal = "#161616" +theme.bg_focus = "#262626" +theme.bg_urgent = "#be95ff" +theme.bg_minimize = "#393939" + + +theme.fg_normal = "#08bdba" +theme.fg_focus = "#ffffff" +theme.fg_urgent = "#ffffff" +theme.fg_minimize = "#ffffff" + +theme.useless_gap = dpi(1) +theme.border_width = dpi(1) +theme.border_normal = "#262626" +theme.border_focus = "#be95ff" +theme.border_marked = "#ee5396" + + + +local taglist_square_size = dpi(4) +theme.taglist_squares_sel = theme_assets.taglist_squares_sel( + taglist_square_size, theme.fg_normal +) +theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel( + taglist_square_size, theme.fg_normal +) + +theme.wallpaper = os.getenv("HOME") .. "/Desktop/wallpaperflare.com_wallpaper.jpg" + +theme.icon_theme = nil + + +local themes_path = gfs.get_themes_dir() + +theme.layout_fairh = themes_path.."default/layouts/fairhw.png" +theme.layout_fairv = themes_path.."default/layouts/fairvw.png" +theme.layout_floating = themes_path.."default/layouts/floatingw.png" +theme.layout_magnifier = themes_path.."default/layouts/magnifierw.png" +theme.layout_max = themes_path.."default/layouts/maxw.png" +theme.layout_fullscreen = themes_path.."default/layouts/fullscreenw.png" +theme.layout_tilebottom = themes_path.."default/layouts/tilebottomw.png" +theme.layout_tileleft = themes_path.."default/layouts/tileleftw.png" +theme.layout_tile = themes_path.."default/layouts/tilew.png" +theme.layout_tiletop = themes_path.."default/layouts/tiletopw.png" +theme.layout_spiral = themes_path.."default/layouts/spiralw.png" +theme.layout_dwindle = themes_path.."default/layouts/dwindlew.png" +theme.layout_cornernw = themes_path.."default/layouts/cornernww.png" +theme.layout_cornerne = themes_path.."default/layouts/cornernew.png" +theme.layout_cornersw = themes_path.."default/layouts/cornersww.png" +theme.layout_cornerse = themes_path.."default/layouts/cornersew.png" + +theme.notification_icon_size = 32 + +return theme diff --git a/home/programs/desktop/awesome/config/themes/default/README b/home/programs/desktop/awesome/config/themes/default/README new file mode 100644 index 0000000..1ddb349 --- /dev/null +++ b/home/programs/desktop/awesome/config/themes/default/README @@ -0,0 +1,3 @@ +Background images: + Mikael Eriksson + Licensed under CC-BY-SA-3.0 diff --git a/home/programs/desktop/awesome/config/themes/default/background.png b/home/programs/desktop/awesome/config/themes/default/background.png new file mode 100644 index 0000000..7ec5812 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/background.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/background_white.png b/home/programs/desktop/awesome/config/themes/default/background_white.png new file mode 100644 index 0000000..bb0c5d0 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/background_white.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/cornerne.png b/home/programs/desktop/awesome/config/themes/default/layouts/cornerne.png new file mode 100644 index 0000000..c85bd56 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/cornerne.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/cornernew.png b/home/programs/desktop/awesome/config/themes/default/layouts/cornernew.png new file mode 100644 index 0000000..c3fd986 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/cornernew.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/cornernw.png b/home/programs/desktop/awesome/config/themes/default/layouts/cornernw.png new file mode 100644 index 0000000..dfe78b3 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/cornernw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/cornernww.png b/home/programs/desktop/awesome/config/themes/default/layouts/cornernww.png new file mode 100644 index 0000000..f489010 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/cornernww.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/cornerse.png b/home/programs/desktop/awesome/config/themes/default/layouts/cornerse.png new file mode 100644 index 0000000..023ae79 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/cornerse.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/cornersew.png b/home/programs/desktop/awesome/config/themes/default/layouts/cornersew.png new file mode 100644 index 0000000..f7cfa1c Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/cornersew.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/cornersw.png b/home/programs/desktop/awesome/config/themes/default/layouts/cornersw.png new file mode 100644 index 0000000..c1453c9 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/cornersw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/cornersww.png b/home/programs/desktop/awesome/config/themes/default/layouts/cornersww.png new file mode 100644 index 0000000..a65a043 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/cornersww.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/dwindle.png b/home/programs/desktop/awesome/config/themes/default/layouts/dwindle.png new file mode 100644 index 0000000..9902d22 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/dwindle.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/dwindlew.png b/home/programs/desktop/awesome/config/themes/default/layouts/dwindlew.png new file mode 100644 index 0000000..9199049 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/dwindlew.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/fairh.png b/home/programs/desktop/awesome/config/themes/default/layouts/fairh.png new file mode 100644 index 0000000..d41deea Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/fairh.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/fairhw.png b/home/programs/desktop/awesome/config/themes/default/layouts/fairhw.png new file mode 100644 index 0000000..bb50e3a Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/fairhw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/fairv.png b/home/programs/desktop/awesome/config/themes/default/layouts/fairv.png new file mode 100644 index 0000000..f5f0288 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/fairv.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/fairvw.png b/home/programs/desktop/awesome/config/themes/default/layouts/fairvw.png new file mode 100644 index 0000000..4f4ed52 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/fairvw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/floating.png b/home/programs/desktop/awesome/config/themes/default/layouts/floating.png new file mode 100644 index 0000000..b8061a0 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/floating.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/floatingw.png b/home/programs/desktop/awesome/config/themes/default/layouts/floatingw.png new file mode 100644 index 0000000..4815894 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/floatingw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/fullscreen.png b/home/programs/desktop/awesome/config/themes/default/layouts/fullscreen.png new file mode 100644 index 0000000..d02f6fc Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/fullscreen.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/fullscreenw.png b/home/programs/desktop/awesome/config/themes/default/layouts/fullscreenw.png new file mode 100644 index 0000000..5c35bfa Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/fullscreenw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/magnifier.png b/home/programs/desktop/awesome/config/themes/default/layouts/magnifier.png new file mode 100644 index 0000000..2925414 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/magnifier.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/magnifierw.png b/home/programs/desktop/awesome/config/themes/default/layouts/magnifierw.png new file mode 100644 index 0000000..6209556 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/magnifierw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/max.png b/home/programs/desktop/awesome/config/themes/default/layouts/max.png new file mode 100644 index 0000000..8d20844 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/max.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/maxw.png b/home/programs/desktop/awesome/config/themes/default/layouts/maxw.png new file mode 100644 index 0000000..85f5ce3 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/maxw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/spiral.png b/home/programs/desktop/awesome/config/themes/default/layouts/spiral.png new file mode 100644 index 0000000..d9434be Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/spiral.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/spiralw.png b/home/programs/desktop/awesome/config/themes/default/layouts/spiralw.png new file mode 100644 index 0000000..b78dd86 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/spiralw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/tile.png b/home/programs/desktop/awesome/config/themes/default/layouts/tile.png new file mode 100644 index 0000000..3ede21e Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/tile.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/tilebottom.png b/home/programs/desktop/awesome/config/themes/default/layouts/tilebottom.png new file mode 100644 index 0000000..6f8c257 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/tilebottom.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/tilebottomw.png b/home/programs/desktop/awesome/config/themes/default/layouts/tilebottomw.png new file mode 100644 index 0000000..a1de7b2 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/tilebottomw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/tileleft.png b/home/programs/desktop/awesome/config/themes/default/layouts/tileleft.png new file mode 100644 index 0000000..31d6870 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/tileleft.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/tileleftw.png b/home/programs/desktop/awesome/config/themes/default/layouts/tileleftw.png new file mode 100644 index 0000000..cf14c25 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/tileleftw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/tiletop.png b/home/programs/desktop/awesome/config/themes/default/layouts/tiletop.png new file mode 100644 index 0000000..98cade2 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/tiletop.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/tiletopw.png b/home/programs/desktop/awesome/config/themes/default/layouts/tiletopw.png new file mode 100644 index 0000000..d1d0872 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/tiletopw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/layouts/tilew.png b/home/programs/desktop/awesome/config/themes/default/layouts/tilew.png new file mode 100644 index 0000000..fde2ca4 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/layouts/tilew.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/old-background.png b/home/programs/desktop/awesome/config/themes/default/old-background.png new file mode 100644 index 0000000..8f52b6b Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/old-background.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/submenu.png b/home/programs/desktop/awesome/config/themes/default/submenu.png new file mode 100644 index 0000000..b2778e2 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/submenu.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/taglist/squarefw.png b/home/programs/desktop/awesome/config/themes/default/taglist/squarefw.png new file mode 100644 index 0000000..2a86430 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/taglist/squarefw.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/taglist/squarew.png b/home/programs/desktop/awesome/config/themes/default/taglist/squarew.png new file mode 100644 index 0000000..913f2ca Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/taglist/squarew.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/theme.lua b/home/programs/desktop/awesome/config/themes/default/theme.lua new file mode 100644 index 0000000..de50dff --- /dev/null +++ b/home/programs/desktop/awesome/config/themes/default/theme.lua @@ -0,0 +1,132 @@ +--------------------------- +-- Default awesome theme -- +--------------------------- + +local theme_assets = require("beautiful.theme_assets") +local xresources = require("beautiful.xresources") +local dpi = xresources.apply_dpi + +local gfs = require("gears.filesystem") +local themes_path = gfs.get_themes_dir() + +local theme = {} + + +theme.font = "sans 8" + +theme.bg_normal = "#222222" +theme.bg_focus = "#535d6c" +theme.bg_urgent = "#ff0000" +theme.bg_minimize = "#444444" +theme.bg_systray = theme.bg_normal + +theme.fg_normal = "#aaaaaa" +theme.fg_focus = "#ffffff" +theme.fg_urgent = "#ffffff" +theme.fg_minimize = "#ffffff" + +theme.useless_gap = dpi(0) +theme.border_width = dpi(1) +theme.border_normal = "#000000" +theme.border_focus = "#535d6c" +theme.border_marked = "#91231c" + +-- There are other variable sets +-- overriding the default one when +-- defined, the sets are: +-- taglist_[bg|fg]_[focus|urgent|occupied|empty|volatile] +-- tasklist_[bg|fg]_[focus|urgent] +-- titlebar_[bg|fg]_[normal|focus] +-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] +-- mouse_finder_[color|timeout|animate_timeout|radius|factor] +-- prompt_[fg|bg|fg_cursor|bg_cursor|font] +-- hotkeys_[bg|fg|border_width|border_color|shape|opacity|modifiers_fg|label_bg|label_fg|group_margin|font|description_font] +-- Example: +--theme.taglist_bg_focus = "#ff0000" + +-- Generate taglist squares: +local taglist_square_size = dpi(4) +theme.taglist_squares_sel = theme_assets.taglist_squares_sel( + taglist_square_size, theme.fg_normal +) +theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel( + taglist_square_size, theme.fg_normal +) + +-- Variables set for theming notifications: +-- notification_font +-- notification_[bg|fg] +-- notification_[width|height|margin] +-- notification_[border_color|border_width|shape|opacity] + +-- Variables set for theming the menu: +-- menu_[bg|fg]_[normal|focus] +-- menu_[border_color|border_width] +theme.menu_submenu_icon = themes_path.."default/submenu.png" +theme.menu_height = dpi(15) +theme.menu_width = dpi(100) + +-- You can add as many variables as +-- you wish and access them by using +-- beautiful.variable in your rc.lua +--theme.bg_widget = "#cc0000" + +-- Define the image to load +theme.titlebar_close_button_normal = themes_path.."default/titlebar/close_normal.png" +theme.titlebar_close_button_focus = themes_path.."default/titlebar/close_focus.png" + +theme.titlebar_minimize_button_normal = themes_path.."default/titlebar/minimize_normal.png" +theme.titlebar_minimize_button_focus = themes_path.."default/titlebar/minimize_focus.png" + +theme.titlebar_ontop_button_normal_inactive = themes_path.."default/titlebar/ontop_normal_inactive.png" +theme.titlebar_ontop_button_focus_inactive = themes_path.."default/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_active = themes_path.."default/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_active = themes_path.."default/titlebar/ontop_focus_active.png" + +theme.titlebar_sticky_button_normal_inactive = themes_path.."default/titlebar/sticky_normal_inactive.png" +theme.titlebar_sticky_button_focus_inactive = themes_path.."default/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_active = themes_path.."default/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_active = themes_path.."default/titlebar/sticky_focus_active.png" + +theme.titlebar_floating_button_normal_inactive = themes_path.."default/titlebar/floating_normal_inactive.png" +theme.titlebar_floating_button_focus_inactive = themes_path.."default/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_active = themes_path.."default/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_active = themes_path.."default/titlebar/floating_focus_active.png" + +theme.titlebar_maximized_button_normal_inactive = themes_path.."default/titlebar/maximized_normal_inactive.png" +theme.titlebar_maximized_button_focus_inactive = themes_path.."default/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_active = themes_path.."default/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_active = themes_path.."default/titlebar/maximized_focus_active.png" + +theme.wallpaper = os.getenv("HOME") .. "/Desktop/wallpaper-aster2.png" --themes_path.."default/background.png" + +-- You can use your own layout icons like this: +theme.layout_fairh = themes_path.."default/layouts/fairhw.png" +theme.layout_fairv = themes_path.."default/layouts/fairvw.png" +theme.layout_floating = themes_path.."default/layouts/floatingw.png" +theme.layout_magnifier = themes_path.."default/layouts/magnifierw.png" +theme.layout_max = themes_path.."default/layouts/maxw.png" +theme.layout_fullscreen = themes_path.."default/layouts/fullscreenw.png" +theme.layout_tilebottom = themes_path.."default/layouts/tilebottomw.png" +theme.layout_tileleft = themes_path.."default/layouts/tileleftw.png" +theme.layout_tile = themes_path.."default/layouts/tilew.png" +theme.layout_tiletop = themes_path.."default/layouts/tiletopw.png" +theme.layout_spiral = themes_path.."default/layouts/spiralw.png" +theme.layout_dwindle = themes_path.."default/layouts/dwindlew.png" +theme.layout_cornernw = themes_path.."default/layouts/cornernww.png" +theme.layout_cornerne = themes_path.."default/layouts/cornernew.png" +theme.layout_cornersw = themes_path.."default/layouts/cornersww.png" +theme.layout_cornerse = themes_path.."default/layouts/cornersew.png" + +-- Generate Awesome icon: +theme.awesome_icon = theme_assets.awesome_icon( + theme.menu_height, theme.bg_focus, theme.fg_focus +) + +-- Define the icon theme for application icons. If not set then the icons +-- from /usr/share/icons and /usr/share/icons/hicolor will be used. +theme.icon_theme = nil + +return theme + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/close_focus.png b/home/programs/desktop/awesome/config/themes/default/titlebar/close_focus.png new file mode 100644 index 0000000..01ef825 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/close_focus.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/close_normal.png b/home/programs/desktop/awesome/config/themes/default/titlebar/close_normal.png new file mode 100644 index 0000000..5448ed8 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/close_normal.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/floating_focus_active.png b/home/programs/desktop/awesome/config/themes/default/titlebar/floating_focus_active.png new file mode 100644 index 0000000..82dcc7c Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/floating_focus_active.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/floating_focus_inactive.png b/home/programs/desktop/awesome/config/themes/default/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..c19ba80 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/floating_focus_inactive.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/floating_normal_active.png b/home/programs/desktop/awesome/config/themes/default/titlebar/floating_normal_active.png new file mode 100644 index 0000000..62342d1 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/floating_normal_active.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/floating_normal_inactive.png b/home/programs/desktop/awesome/config/themes/default/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000..e2bbdfa Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/floating_normal_inactive.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_focus_active.png b/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..d7dffd7 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_focus_active.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_focus_inactive.png b/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..844389f Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_focus_inactive.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_normal_active.png b/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_normal_active.png new file mode 100644 index 0000000..a705f81 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_normal_active.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_normal_inactive.png b/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000..4c1ab1f Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/maximized_normal_inactive.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/minimize_focus.png b/home/programs/desktop/awesome/config/themes/default/titlebar/minimize_focus.png new file mode 100644 index 0000000..caaceb2 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/minimize_focus.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/minimize_normal.png b/home/programs/desktop/awesome/config/themes/default/titlebar/minimize_normal.png new file mode 100644 index 0000000..36621d0 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/minimize_normal.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_focus_active.png b/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..312c00b Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_focus_active.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_focus_inactive.png b/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..a48e1c5 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_focus_inactive.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_normal_active.png b/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_normal_active.png new file mode 100644 index 0000000..117a203 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_normal_active.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_normal_inactive.png b/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_normal_inactive.png new file mode 100644 index 0000000..d3a10c8 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/ontop_normal_inactive.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_focus_active.png b/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..814499b Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_focus_active.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_focus_inactive.png b/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..21b000d Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_focus_inactive.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_normal_active.png b/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_normal_active.png new file mode 100644 index 0000000..bdb5595 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_normal_active.png differ diff --git a/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_normal_inactive.png b/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_normal_inactive.png new file mode 100644 index 0000000..a96b9b1 Binary files /dev/null and b/home/programs/desktop/awesome/config/themes/default/titlebar/sticky_normal_inactive.png differ diff --git a/home/programs/desktop/awesome/default.nix b/home/programs/desktop/awesome/default.nix new file mode 100644 index 0000000..e66913c --- /dev/null +++ b/home/programs/desktop/awesome/default.nix @@ -0,0 +1,12 @@ +{pkgs, ...}: { + xsession.windowManager.awesome = { + enable = true; + noArgb = true; + luaModules = with pkgs; [ + luaPackages.fennel + ]; + }; + xdg.configFile."awesome" = { + source = ./config; + }; +} diff --git a/home/programs/games/default.nix b/home/programs/games/default.nix new file mode 100644 index 0000000..958691c --- /dev/null +++ b/home/programs/games/default.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + heroic + lutris + prismlauncher + gamescope + ]; + programs.mangohud.enable = true; +} diff --git a/home/programs/games/steam.nix b/home/programs/games/steam.nix new file mode 100644 index 0000000..c08b481 --- /dev/null +++ b/home/programs/games/steam.nix @@ -0,0 +1,31 @@ +{ + pkgs, + inputs, + ... +}: let + steam-with-pkgs = pkgs.steam.override { + extraPkgs = pkgs: + with pkgs; [ + xorg.libXcursor + xorg.libXi + xorg.libXinerama + xorg.libXScrnSaver + libpng + libpulseaudio + libvorbis + stdenv.cc.cc.lib + libkrb5 + keyutils + gamescope + gamemode + mangohud + ]; + extraProfile = "export STEAM_EXTRA_COMPAT_TOOLS_PATHS='${inputs.nix-gaming.packages.${pkgs.system}.proton-ge}'"; + }; +in { + home.packages = with pkgs; [ + steam-with-pkgs + steam-run + protontricks + ]; +} diff --git a/home/programs/media/default.nix b/home/programs/media/default.nix new file mode 100644 index 0000000..565dd36 --- /dev/null +++ b/home/programs/media/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./mpv.nix + ]; +} diff --git a/home/programs/media/jellyfin.nix b/home/programs/media/jellyfin.nix new file mode 100644 index 0000000..94a7573 --- /dev/null +++ b/home/programs/media/jellyfin.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + jellyfin-media-player + jellycli + ]; +} diff --git a/home/programs/media/mpv.nix b/home/programs/media/mpv.nix new file mode 100644 index 0000000..87afc20 --- /dev/null +++ b/home/programs/media/mpv.nix @@ -0,0 +1,33 @@ +{pkgs, ...}: { + programs.mpv = { + enable = true; + config = { + vo = "gpu-next"; + gpu-api = "vulkan"; + scale = "ewa_lanczos"; + deband = true; + + sub-auto = "fuzzy"; + slang = ["eng" "en"]; + + save-position-on-quit = true; + + # update watch history + ytdl-raw-options = "mark-watched=,cookies-from-browser=firefox"; + }; + profiles = { + "extension.gif" = { + cache = false; + loop-file = true; + }; + "protocol.https" = { + cache-secs = 100; + user-agent = "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0"; + }; + "protocol.http" = { + cache-secs = 100; + user-agent = "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0"; + }; + }; + }; +} diff --git a/home/programs/misc/discord.nix b/home/programs/misc/discord.nix new file mode 100644 index 0000000..6003f99 --- /dev/null +++ b/home/programs/misc/discord.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + (discord.override { + withVencord = true; + }) + ]; +} diff --git a/home/programs/misc/keepassxc.nix b/home/programs/misc/keepassxc.nix new file mode 100644 index 0000000..0f18e96 --- /dev/null +++ b/home/programs/misc/keepassxc.nix @@ -0,0 +1,7 @@ +{ + pkgs, + lib, + ... +}: { + home.packages = [pkgs.keepassxc]; +} diff --git a/home/programs/music/default.nix b/home/programs/music/default.nix new file mode 100644 index 0000000..8b71a50 --- /dev/null +++ b/home/programs/music/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./mpd.nix + ./ncmpcpp.nix + ]; +} diff --git a/home/programs/music/mpd.nix b/home/programs/music/mpd.nix new file mode 100644 index 0000000..00e250a --- /dev/null +++ b/home/programs/music/mpd.nix @@ -0,0 +1,26 @@ +{ + pkgs, + config, + ... +}: { + services.mpd = { + enable = true; + extraConfig = '' + audio_output { + type "pipewire" + name "PipeWire Sound Server" + } + + audio_output { + type "fifo" + name "Visualizer feed" + path "/tmp/mpd.fifo" + format "44100:16:2" + } + + replaygain "track" + ''; + musicDirectory = config.xdg.userDirs.music; + }; + home.packages = [pkgs.mpc-cli]; +} diff --git a/home/programs/music/ncmpcpp.nix b/home/programs/music/ncmpcpp.nix new file mode 100644 index 0000000..c16d1d6 --- /dev/null +++ b/home/programs/music/ncmpcpp.nix @@ -0,0 +1,48 @@ +{pkgs, ...}: { + programs.ncmpcpp = { + enable = true; + package = pkgs.ncmpcpp.override { + visualizerSupport = true; + clockSupport = true; + }; + bindings = [ + { + key = "j"; + command = "scroll_down"; + } + { + key = "k"; + command = "scroll_up"; + } + { + key = "J"; + command = ["select_item" "scroll_down"]; + } + { + key = "K"; + command = ["select_item" "scroll_up"]; + } + ]; + settings = { + ## Visualizer + visualizer_data_source = "/tmp/mpd.fifo"; + visualizer_output_name = "Visualizer feed"; + visualizer_in_stereo = "yes"; + visualizer_type = "spectrum"; + visualizer_look = "●▮"; + + ## Lyrics + lyrics_fetchers = builtins.concatStringsSep "," [ + "musixmatch" + "sing365" + "metrolyrics" + "justsomelyrics" + "jahlyrics" + "plyrics" + "tekstowo" + "zeneszoveg" + "internet" + ]; + }; + }; +} diff --git a/home/programs/music/yams.nix b/home/programs/music/yams.nix new file mode 100644 index 0000000..93633f5 --- /dev/null +++ b/home/programs/music/yams.nix @@ -0,0 +1,24 @@ +{ + pkgs, + config, + ... +}: { + # authentication needs to be done manually once + # TODO automatic authentication thing + home.packages = with pkgs; [yams]; + systemd.user.services.yams = { + Unit = { + Description = "yams"; + Requires = ["mpd.service"]; + After = ["mpd.service"]; + }; + Install = { + WantedBy = ["default.target"]; + }; + Service = { + Type = "simple"; + Environment = "NON_INTERACTIVE=1"; + ExecStart = "${pkgs.yams}/bin/yams -N"; + }; + }; +} diff --git a/home/services/media/playerctl.nix b/home/services/media/playerctl.nix new file mode 100644 index 0000000..74f8363 --- /dev/null +++ b/home/services/media/playerctl.nix @@ -0,0 +1,4 @@ +{pkgs, ...}: { + home.packages = [pkgs.playerctl]; + services.playerctld.enable = true; +} diff --git a/home/services/system/polkit-agent.nix b/home/services/system/polkit-agent.nix new file mode 100644 index 0000000..dd55fd1 --- /dev/null +++ b/home/services/system/polkit-agent.nix @@ -0,0 +1,19 @@ +{pkgs, ...}: { + systemd.user.services.polkit-gnome-authentication-agent-1 = { + Unit.Description = "polkit-gnome-authentication-agent-1"; + + Install = { + WantedBy = ["graphical-session.target"]; + Wants = ["graphical-session.target"]; + After = ["graphical-session.target"]; + }; + + Service = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; +} diff --git a/home/services/system/udiskie.nix b/home/services/system/udiskie.nix new file mode 100644 index 0000000..f3ea3b8 --- /dev/null +++ b/home/services/system/udiskie.nix @@ -0,0 +1,3 @@ +{ + services.udiskie.enable = true; +} diff --git a/home/terminal/default.nix b/home/terminal/default.nix new file mode 100644 index 0000000..3dfe844 --- /dev/null +++ b/home/terminal/default.nix @@ -0,0 +1,11 @@ +{config, ...}: let + data = config.xdg.dataHome; + conf = config.xdg.configHome; + cache = config.xdg.cacheHome; +in { + imports = [ + ./programs + ./shell/zsh.nix + #./shell/starship.nix + ]; +} diff --git a/home/terminal/emulator/wezterm.nix b/home/terminal/emulator/wezterm.nix new file mode 100644 index 0000000..6f053e6 --- /dev/null +++ b/home/terminal/emulator/wezterm.nix @@ -0,0 +1,49 @@ +{ + programs.wezterm = { + enable = true; + extraConfig = '' + local wezterm = require'wezterm' + local c = {} + if wezterm.config_builder then + c = wezterm.config_builder() + end + c.hide_tab_bar_if_only_one_tab = true + c.color_scheme = "GitHub Dark" + c.window_padding = { left = 10, right = 10, top = 5, bottom = 5 } + c.window_decorations = 'RESIZE' + c.window_close_confirmation = "NeverPrompt" + c.use_fancy_tab_bar = false + + c.font_size = 9 + c.adjust_window_size_when_changing_font_size = true + + + -- Keys + c.leader = { key = 'j', mods = 'CTRL', timeout_milliseconds = 1000 } + c.keys = { + { + key = 'v', + mods = 'LEADER', + action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' }, + }, + { + key = 's', + mods = 'LEADER', + action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' }, + }, + { + key = 'q', + mods = 'LEADER', + action = wezterm.action.CloseCurrentPane { confirm = false }, + }, + { + key = 'f', + mods = 'LEADER', + action = wezterm.action.TogglePaneZoomState, + }, + } + + return c + ''; + }; +} diff --git a/home/terminal/programs/comma.nix b/home/terminal/programs/comma.nix new file mode 100644 index 0000000..8bdf396 --- /dev/null +++ b/home/terminal/programs/comma.nix @@ -0,0 +1,3 @@ +{pkgs, ...}: { + programs.nix-index-database.comma.enable = true; +} diff --git a/home/terminal/programs/default.nix b/home/terminal/programs/default.nix new file mode 100644 index 0000000..139d3ab --- /dev/null +++ b/home/terminal/programs/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./git.nix + ./direnv.nix + ./xdg.nix + ./comma.nix + ]; +} diff --git a/home/terminal/programs/direnv.nix b/home/terminal/programs/direnv.nix new file mode 100644 index 0000000..701f7b3 --- /dev/null +++ b/home/terminal/programs/direnv.nix @@ -0,0 +1,7 @@ +{ + programs.direnv = { + enable = true; + nix-direnv.enable = true; + enableZshIntegration = true; + }; +} diff --git a/home/terminal/programs/git.nix b/home/terminal/programs/git.nix new file mode 100644 index 0000000..687509a --- /dev/null +++ b/home/terminal/programs/git.nix @@ -0,0 +1,23 @@ +{ + lib, + config, + ... +}: { + programs.git = { + enable = true; + delta.enable = true; + lfs.enable = true; + + ignores = ["*~" ".direnv"]; + + signing = { + key = "${config.home.homeDirectory}/.ssh/id_ed25519"; + signByDefault = true; + }; + + extraConfig.gpg.format = "ssh"; + + userEmail = "xunuwu@gmail.com"; + userName = "xunuwu"; + }; +} diff --git a/home/terminal/programs/xdg.nix b/home/terminal/programs/xdg.nix new file mode 100644 index 0000000..cfc34a9 --- /dev/null +++ b/home/terminal/programs/xdg.nix @@ -0,0 +1,26 @@ +{ + config, + pkgs, + ... +}: let + home = config.home.homeDirectory; +in { + xdg = { + enable = true; + cacheHome = config.home.homeDirectory + "/.local/cache"; + + userDirs = { + enable = true; + createDirectories = true; + desktop = home + "/desktop"; + documents = home + "/docs"; + download = home + "/down"; + music = home + "/music"; + pictures = home + "/pics"; + publicShare = home + "/share"; + videos = home + "/vids"; + }; + }; + + home.packages = [pkgs.xdg-utils]; +} diff --git a/home/terminal/shell/starship.nix b/home/terminal/shell/starship.nix new file mode 100644 index 0000000..94ae165 --- /dev/null +++ b/home/terminal/shell/starship.nix @@ -0,0 +1,26 @@ +{config, ...}: { + home.sessionVariables.STARSHIP_CACHE = "${config.xdg.cacheHome}/starship"; + + programs.starship = { + enable = true; + enableZshIntegration = true; + settings = { + character = { + success_symbol = "[›](bold green)"; + error_symbol = "[›](bold red)"; + }; + + git_status = { + deleted = "✗"; + modified = "✶"; + staged = "✓"; + stashed = "≡"; + }; + + nix_shell = { + symbol = " "; + heuristic = true; + }; + }; + }; +} diff --git a/home/terminal/shell/zsh.nix b/home/terminal/shell/zsh.nix new file mode 100644 index 0000000..4839f95 --- /dev/null +++ b/home/terminal/shell/zsh.nix @@ -0,0 +1,33 @@ +{config, ...}: { + programs.zsh = { + enable = true; + autocd = true; + enableCompletion = true; + enableAutosuggestions = true; + dotDir = ".config/zsh"; + defaultKeymap = "emacs"; + history = { + expireDuplicatesFirst = true; + path = "${config.xdg.dataHome}/zsh_history"; + }; + initExtra = '' + unsetopt beep + + ## KEYBINDS ## + bindkey "^[[1;5D" backward-word + bindkey "^[[1;5C" forward-word + WORDCHARS= # this makes ^w actually stop on directory delimiters etc + zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # Case insensitive completion + + + ## PROMPT ## + autoload -Uz vcs_info + precmd_vcs_info() { vcs_info } + precmd_functions+=( precmd_vcs_info ) + zstyle ':vcs_info:git:*' formats ' %b ' + setopt prompt_subst + + PROMPT="%F{blue}[%F{magenta}%n%F{blue}@%F{magenta}%M%F{blue}] %~%f %F{green}\$vcs_info_msg_0_%f%(?..%F{red}| %? )%#%f " + ''; + }; +} diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 0000000..5183653 --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,41 @@ +{ + self, + inputs, + homeImports, + ... +}: { + flake.nixosConfigurations = let + inherit (inputs.nixpkgs.lib) nixosSystem; + mod = "${self}/system"; + + # get the basic config to build on top of + inherit (import "${self}/system") desktop laptop; + + # get these into the module system + specialArgs = {inherit inputs self;}; + in { + nixdesk = nixosSystem { + inherit specialArgs; + modules = + desktop + ++ [ + ./nixdesk + "${mod}/programs/gamemode.nix" + "${self}/secrets" + { + home-manager = { + users.xun.imports = homeImports."xun@nixdesk"; + extraSpecialArgs = specialArgs; + }; + } + ]; + }; + hopper = nixosSystem { + inherit specialArgs; + modules = [ + ./core + ./core/boot.nix + ]; + }; + }; +} diff --git a/hosts/hopper/default.nix b/hosts/hopper/default.nix new file mode 100644 index 0000000..79aa262 --- /dev/null +++ b/hosts/hopper/default.nix @@ -0,0 +1,15 @@ +{inputs}: { + imports = with inputs.hardware.nixosModules; [ + common-cpu-intel + common-pc-hdd + common-gpu-nvidia + + ./hardware.nix + ]; + + networking.hostName = "hopper"; + + swapDevices = []; + + system.stateVersion = "23.11"; +} diff --git a/hosts/hopper/hardware.nix b/hosts/hopper/hardware.nix new file mode 100644 index 0000000..c3179cb --- /dev/null +++ b/hosts/hopper/hardware.nix @@ -0,0 +1,39 @@ +{...}: { + boot = { + initrd = { + availableKernelModules = ["ehci_pci" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; + kernelModules = []; + }; + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + loader = { + systemd-boot = { + enable = true; + configurationLimit = 10; + }; + efi.canTouchEfiVariables = true; + }; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/1297e638-f2ff-49a2-a362-314ac7eeaabc"; + fsType = "btrfs"; + options = ["subvol=root" "compress=zstd"]; + }; + "/home" = { + device = "/dev/disk/by-uuid/1297e638-f2ff-49a2-a362-314ac7eeaabc"; + fsType = "btrfs"; + options = ["subvol=home" "compress=zstd"]; + }; + "/nix" = { + device = "/dev/disk/by-uuid/1297e638-f2ff-49a2-a362-314ac7eeaabc"; + fsType = "btrfs"; + options = ["subvol=nix" "compress=zstd" "noatime"]; + }; + "/boot" = { + device = "/dev/disk/by-uuid/8D4C-2F05"; + fsType = "vfat"; + }; + }; +} diff --git a/hosts/nixdesk/default.nix b/hosts/nixdesk/default.nix new file mode 100644 index 0000000..33caea5 --- /dev/null +++ b/hosts/nixdesk/default.nix @@ -0,0 +1,19 @@ +{ + pkgs, + inputs, + ... +}: { + imports = [ + inputs.hardware.nixosModules.common-cpu-amd + inputs.hardware.nixosModules.common-gpu-amd + inputs.hardware.nixosModules.common-pc-ssd + + ./hardware.nix + ]; + + networking.hostName = "nixdesk"; + + swapDevices = []; + + system.stateVersion = "23.11"; +} diff --git a/hosts/nixdesk/hardware.nix b/hosts/nixdesk/hardware.nix new file mode 100644 index 0000000..64bb6c6 --- /dev/null +++ b/hosts/nixdesk/hardware.nix @@ -0,0 +1,47 @@ +{pkgs, ...}: { + boot = { + initrd = { + availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + kernelModules = ["amdgpu"]; + }; + kernelModules = ["kvm-amd"]; + loader = { + timeout = 10; + systemd-boot = { + enable = true; + consoleMode = "max"; + configurationLimit = 120; + editor = false; + }; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + }; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/0c080ce8-26f0-454b-a100-1ca9d5308931"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/D23A-89BF"; + fsType = "vfat"; + }; + }; + + hardware.enableAllFirmware = true; + + services.xserver.videoDrivers = ["amdgpu"]; + + nixpkgs.hostPlatform.system = "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = true; +} diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..83ded7d --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,5 @@ +{ + flake.nixosModules = { + # name = import ./name + }; +} diff --git a/secrets/default.nix b/secrets/default.nix new file mode 100644 index 0000000..820ff87 --- /dev/null +++ b/secrets/default.nix @@ -0,0 +1,11 @@ +{ + inputs, + config, + lib, + ... +}: { + imports = [ + inputs.sops-nix.nixosModules.sops + ./global + ]; +} diff --git a/secrets/global/default.nix b/secrets/global/default.nix new file mode 100644 index 0000000..4eb90ff --- /dev/null +++ b/secrets/global/default.nix @@ -0,0 +1,8 @@ +{ + sops.secrets = { + tailscale-auth = { + key = "tailscale-auth"; + sopsFile = ./tailscale-auth.yaml; + }; + }; +} diff --git a/secrets/global/tailscale-auth.yaml b/secrets/global/tailscale-auth.yaml new file mode 100644 index 0000000..9e931a7 --- /dev/null +++ b/secrets/global/tailscale-auth.yaml @@ -0,0 +1,30 @@ +tailscale-auth: ENC[AES256_GCM,data:aLtXJaD/PRYtBAS0rixS83dzQZ14NIY0W8HhqQx0b1dXhujmiH+ETOECDivt0zyPByFx2JDh4KNU,iv:1BZTqp87gCNYVS2UCv56X1/BguxitsjdmGv3AJUtWII=,tag:Xh2v9E1shOLN9uc+56jDWA==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age17pdqkpfh6kc6wm7gxzdnwf6vphlwddv9yfpdu3j76e24y3amd9tq3avfc8 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB4NDFCaFgvSkZhQlRqQVht + TERneCtOT1FJaitHcC84Q0p1TUFYbzk1YUNzCitvZ1VERnF1Y2h1c3pUcE5Bakt0 + aDdZVG9Hbk9oZWhPazM4WENGNk0zTUUKLS0tIDFjdEZVQW5KVTdlWnJsYlRndjVm + WGRSUkRtVmgyOGxGVldoSzlqdUNYQTQKX54s95pBnSuyKvcyQb66APolxcWW6/Bj + dou/h8tLVs2DaH87Q6x0n/s2cXvhMUgI0W/IKmdpT0rchhx3eR9I4g== + -----END AGE ENCRYPTED FILE----- + - recipient: age155sscpw0x36t6s9usdrz7relpxqrtqnk98mrc7s0qcv2n0v3zd7sfl2xn8 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBzbUM2VHdyd2JlLzB0R3p1 + YXIvK3BYY3JZT2lKaFB0ckJoVTd5UnJzc0dnClV2d1FKVkhtRWxNc1pBQm96dWFU + aHlGSHVmTG5kQjB0T3ZSUFdiV1pEakEKLS0tIEVOMHVDOFFEYXU2MUtpSXMzQVUv + d3JjTkVWM2piSEZIcjB1SHZkNTZsWnMKOmbBX9YXH4KrNOV7xs60FKyBf3QU2gy4 + K8lHha4EqnG9DMiDsvDQNP49BlKfUSSRTqVQHo1nWEC1m1FQ3Rh47Q== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2024-01-26T23:17:57Z" + mac: ENC[AES256_GCM,data:7vnKNCZsqSCersnIJviHetgTt6qZOvO50yOSWCq+8rPVt5IK9abWtTUEZfDtZI0oIvOsOJjAlvCPLn94kknn6y0UspKE4aTTIGQQctM5cHzFL2xMsOaTqBLLMWxvpkAkWFQ8Lpg5v57/X2Rex8M0x1GRB74/KDDXs4TXz0v9fJk=,iv:ZnbiB2JS7bQZy3QNdyz3Ijbukh2YoH63huCNUijFLcM=,tag:Fhi6/5+X5dMe/cKejunVvA==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.8.1 diff --git a/secrets/nixdesk/default.nix b/secrets/nixdesk/default.nix new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/secrets/nixdesk/default.nix @@ -0,0 +1 @@ +{} diff --git a/system/core/boot.nix b/system/core/boot.nix new file mode 100644 index 0000000..5b4a42c --- /dev/null +++ b/system/core/boot.nix @@ -0,0 +1,34 @@ +{ + pkgs, + config, + ... +}: { + boot = { + initrd = { + systemd.enable = true; + supportedFilesystems = ["ext4"]; + }; + + ## use latest kernel + kernelPackages = pkgs.linuxPackages_latest; + + consoleLogLevel = 3; + kernelParams = [ + "quiet" + "systemd.show_status=auto" + "rd.udev.log_level=3" + ]; + + loader = { + # systemd-boot on UEFI + efi.canTouchEfiVariables = true; + systemd-boot.enable = true; + }; + + plymouth.enable = true; + }; + + environment.systemPackages = [ + config.boot.kernelPackages.cpupower + ]; +} diff --git a/system/core/default.nix b/system/core/default.nix new file mode 100644 index 0000000..522b2e7 --- /dev/null +++ b/system/core/default.nix @@ -0,0 +1,25 @@ +{lib, ...}: { + imports = [ + ./security.nix + ./users.nix + ./tools.nix + ./ssh.nix + ../nix + ../programs/zsh.nix + ]; + + documentation.dev.enable = true; + + i18n = { + defaultLocale = "en_US.UTF-8"; + supportedLocales = [ + "en_US.UTF-8/UTF-8" + ]; + }; + services.xserver.layout = "eu"; + + # don't touch this + system.stateVersion = lib.mkDefault "23.11"; + + time.timeZone = lib.mkDefault "Europe/Stockholm"; +} diff --git a/system/core/security.nix b/system/core/security.nix new file mode 100644 index 0000000..a12d225 --- /dev/null +++ b/system/core/security.nix @@ -0,0 +1,59 @@ +# security tweaks borrowed from @hlissner +{ + boot.kernel.sysctl = { + # The Magic SysRq key is a key combo that allows users connected to the + # system console of a Linux kernel to perform some low-level commands. + # Disable it, since we don't need it, and is a potential security concern. + "kernel.sysrq" = 0; + + ## TCP hardening + # Prevent bogus ICMP errors from filling up logs. + "net.ipv4.icmp_ignore_bogus_error_responses" = 1; + # Reverse path filtering causes the kernel to do source validation of + # packets received from all interfaces. This can mitigate IP spoofing. + "net.ipv4.conf.default.rp_filter" = 1; + "net.ipv4.conf.all.rp_filter" = 1; + # Do not accept IP source route packets (we're not a router) + "net.ipv4.conf.all.accept_source_route" = 0; + "net.ipv6.conf.all.accept_source_route" = 0; + # Don't send ICMP redirects (again, we're not a router) + "net.ipv4.conf.all.send_redirects" = 0; + "net.ipv4.conf.default.send_redirects" = 0; + # Refuse ICMP redirects (MITM mitigations) + "net.ipv4.conf.all.accept_redirects" = 0; + "net.ipv4.conf.default.accept_redirects" = 0; + "net.ipv4.conf.all.secure_redirects" = 0; + "net.ipv4.conf.default.secure_redirects" = 0; + "net.ipv6.conf.all.accept_redirects" = 0; + "net.ipv6.conf.default.accept_redirects" = 0; + # Protects against SYN flood attacks + "net.ipv4.tcp_syncookies" = 1; + # Incomplete protection again TIME-WAIT assassination + "net.ipv4.tcp_rfc1337" = 1; + + ## TCP optimization + # TCP Fast Open is a TCP extension that reduces network latency by packing + # data in the sender’s initial TCP SYN. Setting 3 = enable TCP Fast Open for + # both incoming and outgoing connections: + "net.ipv4.tcp_fastopen" = 3; + # Bufferbloat mitigations + slight improvement in throughput & latency + "net.ipv4.tcp_congestion_control" = "bbr"; + "net.core.default_qdisc" = "cake"; + }; + + boot.kernelModules = ["tcp_bbr"]; + + # Change me later! + #users.users.root.initialPassword = "nixos"; + + security = { + # allow wayland lockers to unlock the screen + pam.services.swaylock.text = "auth include login"; + + # userland niceness + rtkit.enable = true; + + # don't ask for password for wheel group + sudo.wheelNeedsPassword = false; + }; +} diff --git a/system/core/ssh.nix b/system/core/ssh.nix new file mode 100644 index 0000000..1f4c657 --- /dev/null +++ b/system/core/ssh.nix @@ -0,0 +1,22 @@ +{lib, ...}: { + services.openssh = { + enable = lib.mkDefault true; + settings = { + # Use only public keys + PasswordAuthentication = lib.mkForce false; + KbdInteractiveAuthentication = lib.mkForce false; + + # root login is never welcome, except for remote builders + PermitRootLogin = lib.mkForce "prohibit-password"; + }; + + startWhenNeeded = lib.mkDefault true; + openFirewall = lib.mkDefault false; + hostKeys = [ + { + path = "/etc/ssh/ssh_host_ed25519_key"; + type = "ed25519"; + } + ]; + }; +} diff --git a/system/core/tools.nix b/system/core/tools.nix new file mode 100644 index 0000000..a517837 --- /dev/null +++ b/system/core/tools.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + environment.systemPackages = with pkgs; [ + htop + ]; +} diff --git a/system/core/users.nix b/system/core/users.nix new file mode 100644 index 0000000..6ed464c --- /dev/null +++ b/system/core/users.nix @@ -0,0 +1,11 @@ +{pkgs, ...}: { + users.users.xun = { + isNormalUser = true; + initialPassword = "nixos"; + shell = pkgs.zsh; + extraGroups = [ + "video" + "wheel" + ]; + }; +} diff --git a/system/default.nix b/system/default.nix new file mode 100644 index 0000000..cad5047 --- /dev/null +++ b/system/default.nix @@ -0,0 +1,23 @@ +let + desktop = [ + ./core + ./core/boot.nix + + ./hardware/opengl.nix + ./hardware/bluetooth.nix + + ./network/networkd.nix + ./network/avahi.nix + ./network/tailscale.nix + + ./desktop + ./desktop/awesome.nix + + ./programs + + ./services + ./services/pipewire.nix + ]; +in { + inherit desktop; +} diff --git a/system/desktop/awesome.nix b/system/desktop/awesome.nix new file mode 100644 index 0000000..8012199 --- /dev/null +++ b/system/desktop/awesome.nix @@ -0,0 +1,9 @@ +{ + imports = [ + ./x11.nix + ]; + services.xserver = { + enable = true; + windowManager.awesome.enable = true; + }; +} diff --git a/system/desktop/default.nix b/system/desktop/default.nix new file mode 100644 index 0000000..9b19967 --- /dev/null +++ b/system/desktop/default.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: { + xdg = { + portal = { + enable = true; + config = { + common.default = ["gtk"]; + }; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr + xdg-desktop-portal-gtk + ]; + }; + }; +} diff --git a/system/desktop/x11.nix b/system/desktop/x11.nix new file mode 100644 index 0000000..37a13b9 --- /dev/null +++ b/system/desktop/x11.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + environment.systemPackages = with pkgs; [ + xclip + ]; +} diff --git a/system/hardware/bluetooth.nix b/system/hardware/bluetooth.nix new file mode 100644 index 0000000..cb04954 --- /dev/null +++ b/system/hardware/bluetooth.nix @@ -0,0 +1,5 @@ +{ + hardware.bluetooth = { + enable = true; + }; +} diff --git a/system/hardware/opengl.nix b/system/hardware/opengl.nix new file mode 100644 index 0000000..a144a20 --- /dev/null +++ b/system/hardware/opengl.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; +} diff --git a/system/hardware/specialisations.nix b/system/hardware/specialisations.nix new file mode 100644 index 0000000..e27c7a6 --- /dev/null +++ b/system/hardware/specialisations.nix @@ -0,0 +1,12 @@ +{ + specialisation = { + light = { + inheritParentConfig = true; + configuration.programs.matugen.variant = "light"; + }; + dark = { + inheritParentConfig = true; + configuration.programs.matugen.variant = "dark"; + }; + }; +} diff --git a/system/network/avahi.nix b/system/network/avahi.nix new file mode 100644 index 0000000..c885e9c --- /dev/null +++ b/system/network/avahi.nix @@ -0,0 +1,12 @@ +{ + # network discovery, mDNS + services.avahi = { + enable = true; + nssmdns4 = true; + publish = { + enable = true; + domain = true; + userServices = true; + }; + }; +} diff --git a/system/network/networkd.nix b/system/network/networkd.nix new file mode 100644 index 0000000..8969825 --- /dev/null +++ b/system/network/networkd.nix @@ -0,0 +1,15 @@ +{ + networking.useNetworkd = true; + systemd.network = { + enable = true; + networks."10-lan" = { + matchConfig.Name = "lan"; + networkConfig.DHCP = "ipv4"; + }; + }; + services.resolved = { + enable = true; + dnssec = "true"; + domains = ["~."]; + }; +} diff --git a/system/network/tailscale.nix b/system/network/tailscale.nix new file mode 100644 index 0000000..8590f2d --- /dev/null +++ b/system/network/tailscale.nix @@ -0,0 +1,8 @@ +{config, ...}: { + services.tailscale = { + enable = true; + openFirewall = true; + useRoutingFeatures = "client"; + authKeyFile = config.sops.secrets.tailscale-auth.path; + }; +} diff --git a/system/nix/default.nix b/system/nix/default.nix new file mode 100644 index 0000000..6756f77 --- /dev/null +++ b/system/nix/default.nix @@ -0,0 +1,35 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: { + imports = [ + ./nixpkgs.nix + ./substituters.nix + ]; + + # git is needed for flakes + environment.systemPackages = [pkgs.git]; + + nix = { + # pin the registry to avoid downloading and evaling a new nixpkgs version every time + registry = lib.mapAttrs (_: v: {flake = v;}) inputs; + + # set the path for channels compat + nixPath = lib.mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry; + + settings = { + auto-optimise-store = true; + builders-use-substitutes = true; + experimental-features = ["flakes" "nix-command"]; + + # for direnv GC roots + keep-outputs = true; + keep-derivations = true; + + trusted-users = ["root" "@wheel"]; + }; + }; +} diff --git a/system/nix/nixpkgs.nix b/system/nix/nixpkgs.nix new file mode 100644 index 0000000..646317a --- /dev/null +++ b/system/nix/nixpkgs.nix @@ -0,0 +1,6 @@ +{self, ...}: { + nixpkgs = { + config.allowUnfree = true; + config.permittedInsecurePackages = []; + }; +} diff --git a/system/nix/substituters.nix b/system/nix/substituters.nix new file mode 100644 index 0000000..b21c0e2 --- /dev/null +++ b/system/nix/substituters.nix @@ -0,0 +1,16 @@ +{ + nix.settings = { + substituters = [ + # high priority since it's almost always used + "https://cache.nixos.org?priority=10" + "https://nix-community.cachix.org" + "https://nix-gaming.cachix.org" + ]; + + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" + ]; + }; +} diff --git a/system/programs/adb.nix b/system/programs/adb.nix new file mode 100644 index 0000000..435add8 --- /dev/null +++ b/system/programs/adb.nix @@ -0,0 +1,3 @@ +{ + programs.adb.enable = true; +} diff --git a/system/programs/default.nix b/system/programs/default.nix new file mode 100644 index 0000000..3a445a2 --- /dev/null +++ b/system/programs/default.nix @@ -0,0 +1,13 @@ +{ + imports = [ + ./fonts.nix + ./home-manager.nix + ./qt.nix + ./adb.nix + ]; + + programs = { + # make HM-managed GTK stuff work + dconf.enable = true; + }; +} diff --git a/system/programs/fonts.nix b/system/programs/fonts.nix new file mode 100644 index 0000000..fa229ce --- /dev/null +++ b/system/programs/fonts.nix @@ -0,0 +1,28 @@ +{pkgs, ...}: { + fonts = { + packages = with pkgs; [ + powerline-fonts + dejavu_fonts + font-awesome + noto-fonts + noto-fonts-emoji + source-code-pro + iosevka + + # nerdfonts + nerdfonts + #(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) + ]; + + # causes more issues than it solves + enableDefaultPackages = false; + + # user defined fonts + # the reason there's Noto Color Emoji everywhere is to override DejaVu's + # B&W emojis that would sometimes show instead of some Color emojis + fontconfig.defaultFonts = { + monospace = ["DejaVu Sans Mono for Powerline"]; + sansSerif = ["DejaVu Sans"]; + }; + }; +} diff --git a/system/programs/gamemode.nix b/system/programs/gamemode.nix new file mode 100644 index 0000000..3a90136 --- /dev/null +++ b/system/programs/gamemode.nix @@ -0,0 +1,5 @@ +{ + programs.gamemode = { + enable = true; + }; +} diff --git a/system/programs/home-manager.nix b/system/programs/home-manager.nix new file mode 100644 index 0000000..99f9df1 --- /dev/null +++ b/system/programs/home-manager.nix @@ -0,0 +1,9 @@ +{inputs, ...}: { + imports = [ + inputs.home-manager.nixosModules.default + ]; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + }; +} diff --git a/system/programs/qt.nix b/system/programs/qt.nix new file mode 100644 index 0000000..c7d98b3 --- /dev/null +++ b/system/programs/qt.nix @@ -0,0 +1,7 @@ +{ + qt = { + enable = true; + platformTheme = "gtk2"; + style = "gtk2"; + }; +} diff --git a/system/programs/zsh.nix b/system/programs/zsh.nix new file mode 100644 index 0000000..2709f06 --- /dev/null +++ b/system/programs/zsh.nix @@ -0,0 +1,17 @@ +{ + # enable zsh autocompletion for system packages (systemd, etc) + environment.pathsToLink = ["/share/zsh"]; + + programs = { + less.enable = true; + + zsh = { + enable = true; + autosuggestions.enable = true; + syntaxHighlighting = { + enable = true; + highlighters = ["main" "brackets" "pattern"]; + }; + }; + }; +} diff --git a/system/services/default.nix b/system/services/default.nix new file mode 100644 index 0000000..14371b9 --- /dev/null +++ b/system/services/default.nix @@ -0,0 +1,10 @@ +{pkgs, ...}: { + services = { + dbus.implementation = "broker"; + + psd = { + enable = true; + resyncTimer = "10m"; + }; + }; +} diff --git a/system/services/gnome-services.nix b/system/services/gnome-services.nix new file mode 100644 index 0000000..8e90360 --- /dev/null +++ b/system/services/gnome-services.nix @@ -0,0 +1,12 @@ +{pkgs, ...}: { + services = { + dbus.packages = with pkgs; [ + gcr + gnome.gnome-settings-daemon + ]; + + gnome.gnome-keyring.enable = true; + + gvfs.enable = true; + }; +} diff --git a/system/services/pipewire.nix b/system/services/pipewire.nix new file mode 100644 index 0000000..642d9d7 --- /dev/null +++ b/system/services/pipewire.nix @@ -0,0 +1,11 @@ +{lib, ...}: { + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + jack.enable = true; + pulse.enable = true; + }; + + hardware.pulseaudio.enable = lib.mkForce false; +} diff --git a/system/services/syncthing.nix b/system/services/syncthing.nix new file mode 100644 index 0000000..066be8d --- /dev/null +++ b/system/services/syncthing.nix @@ -0,0 +1,42 @@ +{ + services.syncthing = { + enable = true; + openDefaultPorts = true; + user = "xun"; + group = "users"; + dataDir = "/home/xun/.local/share/syncthing"; + configDir = "/home/xun/.config/syncthing"; + + overrideDevices = true; + settings = { + devices = { + "nixdesk" = { + id = "2WCEQPF-2J4U7IK-XRT25FV-NFT2JEM-AVOMDEK-FIJNZ24-7WCBZC2-57CX2AP"; + autoAcceptFolders = true; + }; + "redmi-note-10-pro" = { + id = "U6YYTHR-2ZXIEXQ-RNDERSF-CTVSP67-W24VK4Y-5EQRIV5-T7JJW2N-33L7XQV"; + autoAcceptFolders = true; + }; + "hopper" = { + id = "DK3RPET-ACMULD2-TLQS6YM-XWUMS3N-JRNDNME-YTM3H4X-P7QVUKB-N3PL5QF"; + autoAcceptFolders = true; + }; + }; + folders = { + "~/secrets" = { + devices = [ + "nixdesk" + "redmi-note-10-pro" + "hopper" + ]; + id = "sfw9y-yusup"; + }; + }; + }; + + settings.options.urAccepted = -1; # disable usage reporting + settings.gui.insecureSkipHostcheck = true; + settings.gui.insecureAdminAccess = true; + }; +}