From 106bc1348dcb75fdb79d75006b9b81c37406966d Mon Sep 17 00:00:00 2001 From: Fabian Montero <fabian@posixlycorrect.com> Date: Sun, 8 Sep 2024 15:23:22 -0600 Subject: [PATCH] add desktop platform --- flake.lock | 1295 +++++++++++++++++ flake.nix | 25 +- home/default.nix | 57 + .../fabian@posixlycorrect/default.nix | 39 + .../fabian@posixlycorrect/gui/autorandr.nix | 35 + .../fabian@posixlycorrect/gui/default.nix | 20 + .../fabian@posixlycorrect/gui/fonts.nix | 12 + .../fabian@posixlycorrect/gui/gtk.nix | 12 + .../fabian@posixlycorrect/gui/i3.nix | 104 ++ .../fabian@posixlycorrect/gui/polybar.nix | 459 ++++++ .../fabian@posixlycorrect/gui/startx.nix | 16 + .../fabian@posixlycorrect/isolation.nix | 22 + .../fabian@posixlycorrect/lib/default.nix | 52 + .../lib/steam/default.nix | 14 + .../lib/steam/package.nix | 9 + .../lib/terminal/default.nix | 35 + .../lib/terminal/kitty.conf.nix | 87 ++ .../fabian@posixlycorrect/shenvs/c.nix | 13 + .../fabian@posixlycorrect/shenvs/python.nix | 11 + .../fabian@posixlycorrect/systemd/default.nix | 10 + home/zshrc.nix | 136 ++ pkgs/config/default.nix | 2 +- pkgs/config/unfree.nix | 2 - sys/default.nix | 1 + sys/platforms/posixlycorrect/default.nix | 104 ++ .../posixlycorrect/hardware-configuration.nix | 43 + 26 files changed, 2602 insertions(+), 13 deletions(-) create mode 100644 flake.lock create mode 100644 home/default.nix create mode 100644 home/platforms/fabian@posixlycorrect/default.nix create mode 100644 home/platforms/fabian@posixlycorrect/gui/autorandr.nix create mode 100644 home/platforms/fabian@posixlycorrect/gui/default.nix create mode 100644 home/platforms/fabian@posixlycorrect/gui/fonts.nix create mode 100644 home/platforms/fabian@posixlycorrect/gui/gtk.nix create mode 100644 home/platforms/fabian@posixlycorrect/gui/i3.nix create mode 100644 home/platforms/fabian@posixlycorrect/gui/polybar.nix create mode 100644 home/platforms/fabian@posixlycorrect/gui/startx.nix create mode 100644 home/platforms/fabian@posixlycorrect/isolation.nix create mode 100644 home/platforms/fabian@posixlycorrect/lib/default.nix create mode 100644 home/platforms/fabian@posixlycorrect/lib/steam/default.nix create mode 100644 home/platforms/fabian@posixlycorrect/lib/steam/package.nix create mode 100644 home/platforms/fabian@posixlycorrect/lib/terminal/default.nix create mode 100644 home/platforms/fabian@posixlycorrect/lib/terminal/kitty.conf.nix create mode 100644 home/platforms/fabian@posixlycorrect/shenvs/c.nix create mode 100644 home/platforms/fabian@posixlycorrect/shenvs/python.nix create mode 100644 home/platforms/fabian@posixlycorrect/systemd/default.nix create mode 100644 home/zshrc.nix create mode 100644 sys/default.nix create mode 100644 sys/platforms/posixlycorrect/default.nix create mode 100644 sys/platforms/posixlycorrect/hardware-configuration.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4c678c0 --- /dev/null +++ b/flake.lock @@ -0,0 +1,1295 @@ +{ + "nodes": { + "attic": { + "inputs": { + "crane": "crane", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1720542474, + "narHash": "sha256-aKjJ/4l2I9+wNGTaOGRsuS3M1+IoTibqgEMPDikXm04=", + "owner": "zhaofengli", + "repo": "attic", + "rev": "6139576a3ce6bb992e0f6c3022528ec233e45f00", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "main", + "repo": "attic", + "type": "github" + } + }, + "authentik-nix": { + "inputs": { + "authentik-src": "authentik-src", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "flake-utils": "flake-utils", + "napalm": "napalm", + "nixpkgs": [ + "nixpkgs" + ], + "poetry2nix": "poetry2nix", + "systems": "systems" + }, + "locked": { + "lastModified": 1725809370, + "narHash": "sha256-uUc+TbF17Q9H00aj1cbZGB25Tob6PpZ9M0RoY/jOo6s=", + "owner": "nix-community", + "repo": "authentik-nix", + "rev": "0fd076529b40e7fc7304a398618cab76ff7e96c3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "authentik-nix", + "type": "github" + } + }, + "authentik-src": { + "flake": false, + "locked": { + "lastModified": 1725718494, + "narHash": "sha256-X4Bwm7s6/8HcvKE+kyqwU+M1GEK/+RVHtDK1GpkuM4s=", + "owner": "goauthentik", + "repo": "authentik", + "rev": "f5580d311d01f2202b666f76931ed04f30b9ec30", + "type": "github" + }, + "original": { + "owner": "goauthentik", + "ref": "version/2024.8.1", + "repo": "authentik", + "type": "github" + } + }, + "cachix": { + "inputs": { + "devenv": "devenv", + "flake-compat": "flake-compat_4", + "nixpkgs": "nixpkgs_3", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1719923519, + "narHash": "sha256-7Rhljj2fsklFRsu+eq7N683Z9qukmreMEj5C1GqCrSA=", + "owner": "cachix", + "repo": "cachix", + "rev": "4e9e71f78b9500fa6210cf1eaa4d75bdbab777c3", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "master", + "repo": "cachix", + "type": "github" + } + }, + "cachix_2": { + "inputs": { + "devenv": "devenv_2", + "flake-compat": [ + "conduwuit", + "cachix", + "devenv", + "flake-compat" + ], + "nixpkgs": [ + "conduwuit", + "cachix", + "devenv", + "nixpkgs" + ], + "pre-commit-hooks": [ + "conduwuit", + "cachix", + "devenv", + "pre-commit-hooks" + ] + }, + "locked": { + "lastModified": 1712055811, + "narHash": "sha256-7FcfMm5A/f02yyzuavJe06zLa9hcMHsagE28ADcmQvk=", + "owner": "cachix", + "repo": "cachix", + "rev": "02e38da89851ec7fec3356a5c04bc8349cae0e30", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "cachix", + "type": "github" + } + }, + "complement": { + "flake": false, + "locked": { + "lastModified": 1720637557, + "narHash": "sha256-oZz6nCmFmdJZpC+K1iOG2KkzTI6rlAmndxANPDVU7X0=", + "owner": "matrix-org", + "repo": "complement", + "rev": "0d14432e010482ea9e13a6f7c47c1533c0c9d62f", + "type": "github" + }, + "original": { + "owner": "matrix-org", + "ref": "main", + "repo": "complement", + "type": "github" + } + }, + "conduwuit": { + "inputs": { + "attic": "attic", + "cachix": "cachix", + "complement": "complement", + "crane": "crane_2", + "fenix": "fenix", + "flake-compat": "flake-compat_6", + "flake-utils": "flake-utils_4", + "liburing": "liburing", + "nix-filter": "nix-filter", + "nixpkgs": [ + "unstable" + ], + "rocksdb": "rocksdb" + }, + "locked": { + "lastModified": 1721105087, + "narHash": "sha256-t74TUSswsCkOdZCKjgP74qEHKg78ShKTkP6x9/zqYX4=", + "owner": "girlbossceo", + "repo": "conduwuit", + "rev": "c29197b3f457cf72197ef5251f9815107b2526d7", + "type": "github" + }, + "original": { + "owner": "girlbossceo", + "ref": "v0.4.5", + "repo": "conduwuit", + "type": "github" + } + }, + "crane": { + "inputs": { + "nixpkgs": [ + "conduwuit", + "attic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717025063, + "narHash": "sha256-dIubLa56W9sNNz0e8jGxrX3CAkPXsq7snuFA/Ie6dn8=", + "owner": "ipetkov", + "repo": "crane", + "rev": "480dff0be03dac0e51a8dfc26e882b0d123a450e", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "crane_2": { + "inputs": { + "nixpkgs": [ + "conduwuit", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720546058, + "narHash": "sha256-iU2yVaPIZm5vMGdlT0+57vdB/aPq/V5oZFBRwYw+HBM=", + "owner": "ipetkov", + "repo": "crane", + "rev": "2d83156f23c43598cf44e152c33a59d3892f8b29", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "ref": "master", + "repo": "crane", + "type": "github" + } + }, + "devenv": { + "inputs": { + "cachix": "cachix_2", + "flake-compat": [ + "conduwuit", + "cachix", + "flake-compat" + ], + "nix": "nix_2", + "nixpkgs": [ + "conduwuit", + "cachix", + "nixpkgs" + ], + "pre-commit-hooks": [ + "conduwuit", + "cachix", + "pre-commit-hooks" + ] + }, + "locked": { + "lastModified": 1719759336, + "narHash": "sha256-3a34VL/QnHprl5gMy9xlx6d8J+iNp+W88Ex8smkgH9M=", + "owner": "cachix", + "repo": "devenv", + "rev": "bb32aa986f2f695385e54428d0eaf7d05b31466e", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "devenv_2": { + "inputs": { + "flake-compat": [ + "conduwuit", + "cachix", + "devenv", + "cachix", + "flake-compat" + ], + "nix": "nix", + "nixpkgs": "nixpkgs_2", + "poetry2nix": "poetry2nix_2", + "pre-commit-hooks": [ + "conduwuit", + "cachix", + "devenv", + "cachix", + "pre-commit-hooks" + ] + }, + "locked": { + "lastModified": 1708704632, + "narHash": "sha256-w+dOIW60FKMaHI1q5714CSibk99JfYxm0CzTinYWr+Q=", + "owner": "cachix", + "repo": "devenv", + "rev": "2ee4450b0f4b95a1b90f2eb5ffea98b90e48c196", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "python-rewrite", + "repo": "devenv", + "type": "github" + } + }, + "fenix": { + "inputs": { + "nixpkgs": [ + "conduwuit", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1720852044, + "narHash": "sha256-3NBYz8VuXuKU+8ONd9NFafCNjPEGHIZQ2Mdoam1a4mY=", + "owner": "nix-community", + "repo": "fenix", + "rev": "5087b12a595ee73131a944d922f24d81dae05725", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "main", + "repo": "fenix", + "type": "github" + } + }, + "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-compat_3": { + "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-compat_4": { + "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_5": { + "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_6": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "ref": "master", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1725234343, + "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": [ + "authentik-nix", + "systems" + ] + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "ref": "main", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_6": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_7": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "conduwuit", + "cachix", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "hm-isolation": { + "locked": { + "lastModified": 1675806557, + "narHash": "sha256-39NPKKwU7JflyDG9Cn36UPPelkcNATsrCaoazuIO5PA=", + "owner": "3442", + "repo": "hm-isolation", + "rev": "0b435299c3735231bf4faf1ea7de32d03f070056", + "type": "github" + }, + "original": { + "owner": "3442", + "repo": "hm-isolation", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1725703823, + "narHash": "sha256-tDgM4d8mLK0Hd6YMB2w1BqMto1XBXADOzPEaLl10VI4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "208df2e558b73b6a1f0faec98493cb59a25f62ba", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.05", + "repo": "home-manager", + "type": "github" + } + }, + "homepage": { + "inputs": { + "flake-utils": "flake-utils_6", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1725437989, + "narHash": "sha256-wxBIg9A4X3nvWpgpiG/MjkEIOH3Oxy4Qdhq50BF42jk=", + "ref": "master", + "rev": "a49523cc42d61e0dac0d3dcb01cc1ca3fad7070c", + "revCount": 19, + "type": "git", + "url": "https://git.posixlycorrect.com/fabian/homepage.git" + }, + "original": { + "ref": "master", + "type": "git", + "url": "https://git.posixlycorrect.com/fabian/homepage.git" + } + }, + "impermanence": { + "locked": { + "lastModified": 1725690722, + "narHash": "sha256-4qWg9sNh5g1qPGO6d/GV2ktY+eDikkBTbWSg5/iD2nY=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "63f4d0443e32b0dd7189001ee1894066765d18a5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, + "liburing": { + "flake": false, + "locked": { + "lastModified": 1720798442, + "narHash": "sha256-gtPppAoksMLW4GuruQ36nf4EAqIA1Bs6V9Xcx8dBxrQ=", + "owner": "axboe", + "repo": "liburing", + "rev": "1d674f83b7d0f07553ac44d99a401b05853d9dbe", + "type": "github" + }, + "original": { + "owner": "axboe", + "ref": "master", + "repo": "liburing", + "type": "github" + } + }, + "mediawikiSkinCitizen": { + "flake": false, + "locked": { + "lastModified": 1724097552, + "narHash": "sha256-+o5FDWMrEqnva5qcdc45wAYyE2ZtUhEjygUGVt0HsaA=", + "owner": "StarCitizenTools", + "repo": "mediawiki-skins-Citizen", + "rev": "28cd4e18b52aed3270fe7b55bff4545c8314a687", + "type": "github" + }, + "original": { + "owner": "StarCitizenTools", + "ref": "v2.27.0", + "repo": "mediawiki-skins-Citizen", + "type": "github" + } + }, + "napalm": { + "inputs": { + "flake-utils": [ + "authentik-nix", + "flake-utils" + ], + "nixpkgs": [ + "authentik-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1725806412, + "narHash": "sha256-lGZjkjds0p924QEhm/r0BhAxbHBJE1xMOldB/HmQH04=", + "owner": "willibutz", + "repo": "napalm", + "rev": "b492440d9e64ae20736d3bec5c7715ffcbde83f5", + "type": "github" + }, + "original": { + "owner": "willibutz", + "ref": "avoid-foldl-stack-overflow", + "repo": "napalm", + "type": "github" + } + }, + "nix": { + "inputs": { + "flake-compat": "flake-compat_3", + "nixpkgs": [ + "conduwuit", + "cachix", + "devenv", + "cachix", + "devenv", + "nixpkgs" + ], + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1712911606, + "narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=", + "owner": "domenkozar", + "repo": "nix", + "rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12", + "type": "github" + }, + "original": { + "owner": "domenkozar", + "ref": "devenv-2.21", + "repo": "nix", + "type": "github" + } + }, + "nix-filter": { + "locked": { + "lastModified": 1710156097, + "narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "3342559a24e85fc164b295c3444e8a139924675b", + "type": "github" + }, + "original": { + "owner": "numtide", + "ref": "main", + "repo": "nix-filter", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "authentik-nix", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703863825, + "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nix-github-actions_2": { + "inputs": { + "nixpkgs": [ + "conduwuit", + "cachix", + "devenv", + "cachix", + "devenv", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1688870561, + "narHash": "sha256-4UYkifnPEw1nAzqqPOTL2MvWtm3sNGw1UTYTalkTcGY=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "165b1650b753316aa7f1787f3005a8d2da0f5301", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nixGL": { + "inputs": { + "flake-utils": "flake-utils_7", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1713543440, + "narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=", + "owner": "guibou", + "repo": "nixGL", + "rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a", + "type": "github" + }, + "original": { + "owner": "guibou", + "repo": "nixGL", + "type": "github" + } + }, + "nix_2": { + "inputs": { + "flake-compat": [ + "conduwuit", + "cachix", + "devenv", + "flake-compat" + ], + "nixpkgs": [ + "conduwuit", + "cachix", + "devenv", + "nixpkgs" + ], + "nixpkgs-regression": "nixpkgs-regression_2" + }, + "locked": { + "lastModified": 1712911606, + "narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=", + "owner": "domenkozar", + "repo": "nix", + "rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12", + "type": "github" + }, + "original": { + "owner": "domenkozar", + "ref": "devenv-2.21", + "repo": "nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1711401922, + "narHash": "sha256-QoQqXoj8ClGo0sqD/qWKFWezgEwUL0SUh37/vY2jNhc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "07262b18b97000d16a4bdb003418bd2fb067a932", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1725233747, + "narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" + } + }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs-regression_2": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1711460390, + "narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "44733514b72e732bd49f5511bd0203dea9b9a434", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1718811006, + "narHash": "sha256-0Y8IrGhRmBmT7HHXlxxepg2t8j1X90++qRN3lukGaIk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "03d771e513ce90147b65fe922d87d3a0356fc125", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1692808169, + "narHash": "sha256-x9Opq06rIiwdwGeK2Ykj69dNc2IvUH1fY55Wm7atwrE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9201b5ff357e781bf014d0330d18555695df7ba8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1719848872, + "narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1719426051, + "narHash": "sha256-yJL9VYQhaRM7xs0M867ZFxwaONB9T2Q4LnGo1WovuR4=", + "path": "/nix/store/f0ddmw6s86y567yg06h5019z72szbzch-source", + "rev": "89c49874fb15f4124bf71ca5f42a04f2ee5825fd", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1660551188, + "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1725826545, + "narHash": "sha256-L64N1rpLlXdc94H+F6scnrbuEu+utC03cDDVvvJGOME=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f4c846aee8e1e29062aa8514d5e0ab270f4ec2f9", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "locked": { + "lastModified": 1726022314, + "narHash": "sha256-VR7O2VQh5aQ0tEHTWPJNvjGjmdHmfqexu3VoAA/sMLM=", + "owner": "nix-community", + "repo": "NUR", + "rev": "d1d1e8640bbcff47c11c5d8f575d6c47be956089", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "poetry2nix": { + "inputs": { + "flake-utils": [ + "authentik-nix", + "flake-utils" + ], + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "authentik-nix", + "nixpkgs" + ], + "systems": [ + "authentik-nix", + "systems" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1725532428, + "narHash": "sha256-dCfawQDwpukcwQw++Cn/3LIh/RZMmH+k3fm91Oc5Pf0=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "a313fd7169ae43ecd1a2ea2f1e4899fe3edba4d2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, + "poetry2nix_2": { + "inputs": { + "flake-utils": "flake-utils_3", + "nix-github-actions": "nix-github-actions_2", + "nixpkgs": [ + "conduwuit", + "cachix", + "devenv", + "cachix", + "devenv", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1692876271, + "narHash": "sha256-IXfZEkI0Mal5y1jr6IRWMqK8GW2/f28xJenZIPQqkY0=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "d5006be9c2c2417dafb2e2e5034d83fabd207ee3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_5", + "gitignore": "gitignore", + "nixpkgs": [ + "conduwuit", + "cachix", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_2" + }, + "locked": { + "lastModified": 1719259945, + "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "rocksdb": { + "flake": false, + "locked": { + "lastModified": 1720900786, + "narHash": "sha256-Vta9Um/RRuWwZ46BjXftV06iWLm/j/9MX39emXUvSAY=", + "owner": "girlbossceo", + "repo": "rocksdb", + "rev": "911f4243e69c2e320a7a209bf1f5f3ff5f825495", + "type": "github" + }, + "original": { + "owner": "girlbossceo", + "ref": "v9.4.0", + "repo": "rocksdb", + "type": "github" + } + }, + "root": { + "inputs": { + "authentik-nix": "authentik-nix", + "conduwuit": "conduwuit", + "flake-utils": "flake-utils_5", + "hm-isolation": "hm-isolation", + "home-manager": "home-manager", + "homepage": "homepage", + "impermanence": "impermanence", + "mediawikiSkinCitizen": "mediawikiSkinCitizen", + "nixGL": "nixGL", + "nixpkgs": "nixpkgs_6", + "nur": "nur", + "unstable": "unstable", + "vpsadminos": "vpsadminos" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1720717809, + "narHash": "sha256-6I+fm+nTLF/iaj7ffiFGlSY7POmubwUaPA/Wq0Bm53M=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "ffbc5ad993d5cd2f3b8bcf9a511165470944ab91", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "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" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "authentik-nix", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719749022, + "narHash": "sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "unstable": { + "locked": { + "lastModified": 1725634671, + "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "vpsadminos": { + "locked": { + "lastModified": 1725810385, + "narHash": "sha256-+6UULi05KMHmLfhlrNGhMdLZUoQeC5Dc1nLFdINyeyI=", + "owner": "vpsfreecz", + "repo": "vpsadminos", + "rev": "37c5eb47ca3f11deac83e4ada20a6c21d5487f29", + "type": "github" + }, + "original": { + "owner": "vpsfreecz", + "repo": "vpsadminos", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 8f31fc7..1e64c96 100644 --- a/flake.nix +++ b/flake.nix @@ -57,7 +57,11 @@ inherit system; config = import ./pkgs/config nixpkgs.lib; - overlays = [nur.overlay self.overlays.default]; + overlays = [ + self.overlays.default + nur.overlay + nixGL.overlay + ]; }; pkgs = importPkgs nixpkgs; @@ -101,11 +105,11 @@ homeConfigurations = let registry = {...}: { - config.nix.registry = mapAttrs (_: - value { + config.nix.registry = + mapAttrs (_: value: { flake = value; }) - flakes; + flakes; }; home = platform: @@ -114,17 +118,18 @@ modules = [ ./home - platforms + platform registry hm-isolation.homeManagerModule ]; + + extraSpecialArgs = { + inherit flakes; + }; }; - platformHome = name: platform: let - value = home platform; - in { - inherit name value; - }; + platformHome = name: platform: + nameValuePair name (home platform); in mapAttrs' platformHome (importAll {root = ./home/platforms;}); }; diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..4d1f088 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,57 @@ +#TODO: keys will not be shared in all platforms +{ + flakes, + config, + pkgs, + lib, + ... +}: +with lib; { + xdg.enable = true; + + programs = { + zsh = { + enable = true; + syntaxHighlighting.enable = true; + initExtra = import ./zshrc.nix pkgs; + }; + + git = { + enable = true; + userEmail = "fabian@posixlycorrect.com"; + userName = "Fabian Montero"; + signing = { + key = "7AA277E604A4173916BBB4E91FFAC35E1798174F"; + signByDefault = true; + }; + }; + gpg = { + enable = true; + settings = { + default-key = "7AA277E604A4173916BBB4E91FFAC35E1798174F"; + }; + }; + }; + + services.gpg-agent = { + enable = true; + enableZshIntegration = true; + pinentryPackage = pkgs.pinentry-emacs; + }; + + accounts.email.accounts = { + "fabian@posixlycorrect.com" = { + address = "fabian@posixlycorrect.com"; + userName = "fabianmontero@fastmail.com"; + realName = "fabian"; + primary = true; + flavor = "fastmail.com"; + + gpg = { + encryptByDefault = true; + signByDefault = true; + key = "7AA277E604A4173916BBB4E91FFAC35E1798174F"; + }; + }; + }; +} diff --git a/home/platforms/fabian@posixlycorrect/default.nix b/home/platforms/fabian@posixlycorrect/default.nix new file mode 100644 index 0000000..65bd0a2 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/default.nix @@ -0,0 +1,39 @@ +{ + flakes, + config, + pkgs, + lib, + ... +}: { + imports = [ + ./lib + ./systemd + ./gui + ./isolation.nix + ]; + + nix.registry = { + "system".to = { + type = "path"; + path = "/home/fabian/nix"; + }; + + "nixpkgs".flake = flakes.nixpkgs; + "unstable".flake = flakes.unstable; + }; + + home = { + stateVersion = "21.11"; # No tocar esto + username = "fabian"; + homeDirectory = "/home/fabian"; + sessionVariables = { + "EDITOR" = "nvim"; + "TERMINAL" = "kitty"; + }; + keyboard = { + layout = "us"; + variant = "altgr-intl"; + }; + }; + programs.home-manager.enable = true; +} diff --git a/home/platforms/fabian@posixlycorrect/gui/autorandr.nix b/home/platforms/fabian@posixlycorrect/gui/autorandr.nix new file mode 100644 index 0000000..d645250 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/gui/autorandr.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: { + programs.autorandr = { + enable = true; + profiles."posixlycorrect" = { + fingerprint = { + DP-1 = "00ffffffffffff003669a03bd4040000231e0104a5341d783bd005ac5048a627125054bfcf00814081809500714f81c0b30001010101023a801871382d40582c450009252100001e0882805070384d400820f80c09252100001a000000fd003090b4b422010a202020202020000000fc004d53492047323443340a20202001a2020320f14d010304131f120211900e0f1d1e230907078301000065030c001000866f80a0703840403020350009252100001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e9"; + DP-2 = "00ffffffffffff0009d1e77845540000061f0104a5351e783a0565a756529c270f5054a56b80d1c0b300a9c08180810081c001010101023a801871382d40582c45000f282100001e000000ff0039324d30303033323031510a20000000fd00324c1e5311010a202020202020000000fc0042656e51204757323438300a20019b02031cf14f901f041303120211011406071516052309070783010000023a801871382d40582c45000f282100001f011d8018711c1620582c25000f282100009f011d007251d01e206e2855000f282100001e8c0ad08a20e02d10103e96000f28210000180000000000000000000000000000000000000000000000000000008d"; + }; + config = { + DP-1 = { + enable = true; + primary = true; + position = "0x0"; + mode = "1920x1080"; + rate = "143.85"; + rotate = "normal"; + }; + + DP-2 = { + enable = true; + primary = false; + position = "1920x0"; + mode = "1920x1080"; + rate = "59.94"; + rotate = "normal"; + }; + }; + }; + }; +} diff --git a/home/platforms/fabian@posixlycorrect/gui/default.nix b/home/platforms/fabian@posixlycorrect/gui/default.nix new file mode 100644 index 0000000..d649b87 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/gui/default.nix @@ -0,0 +1,20 @@ +{ + config, + pkgs, + lib, + ... +}: { + imports = [ + ./autorandr.nix + ./fonts.nix + ./i3.nix + ./polybar.nix + ./startx.nix + ]; + + services = { + picom.enable = true; + dunst.enable = true; + betterlockscreen.enable = true; + }; +} diff --git a/home/platforms/fabian@posixlycorrect/gui/fonts.nix b/home/platforms/fabian@posixlycorrect/gui/fonts.nix new file mode 100644 index 0000000..375145a --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/gui/fonts.nix @@ -0,0 +1,12 @@ +{ + config, + lib, + pkgs, + ... +}: { + fonts.fontconfig.enable = true; + + home.packages = with pkgs; [ + jetbrains-mono + ]; +} diff --git a/home/platforms/fabian@posixlycorrect/gui/gtk.nix b/home/platforms/fabian@posixlycorrect/gui/gtk.nix new file mode 100644 index 0000000..eae736f --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/gui/gtk.nix @@ -0,0 +1,12 @@ +#TODO: do i really need to take all these args? +{ + config, + lib, + pkgs, + ... +}: { + home.packages = with pkgs; [ + gruvbox-dark-icons-gtk + libsForQt5.breeze-gtk + ]; +} diff --git a/home/platforms/fabian@posixlycorrect/gui/i3.nix b/home/platforms/fabian@posixlycorrect/gui/i3.nix new file mode 100644 index 0000000..d38e9f2 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/gui/i3.nix @@ -0,0 +1,104 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; { + xsession.windowManager.i3 = { + enable = true; + package = pkgs.i3-gaps; + + config = let + mod = "Mod4"; + in { + modifier = mod; + + fonts = { + names = ["JetBrains Mono"]; + style = "Regular"; + size = 8.0; + }; + + gaps = { + inner = 10; + outer = -10; + }; + + window = { + hideEdgeBorders = "both"; + }; + + colors = { + focused = { + background = "#222222"; + border = "#4c7899"; + childBorder = "#222222"; + indicator = "#292d2e"; + text = "#888888"; + }; + }; + + # mkOptionDefault hace que se ponga la config por default + # y se sobreescriba las cosas que pongo acá + # NO QUITARLO. ver man home-configuration.nix + keybindings = mkOptionDefault { + "${mod}+Return" = "exec ${pkgs.kitty}/bin/kitty ${pkgs.tmux}/bin/tmux"; + "${mod}+Tab" = "focus right"; + "${mod}+Shift+Tab" = "focus left"; + "${mod}+Shift+s" = "exec ${pkgs.maim}/bin/maim -s -u | ${pkgs.xclip}/bin/xclip -selection clipboard -t image/png -i"; + "${mod}+Shift+w" = "move workspace to output right"; + "${mod}+l" = "exec ${pkgs.betterlockscreen}/bin/betterlockscreen -l"; + }; + + startup = [ + { + command = "${pkgs.xss-lock}/bin/xss-lock --transfer-sleep-lock -- ${pkgs.i3lock}/bin/i3lock --nofork"; + notification = false; + } + { + command = "${pkgs.networkmanagerapplet}/bin/nm-applet"; + notification = false; + } + # sería nice hostear esta imagen en el server y fetchearla si no existe + { + command = "${pkgs.feh}/bin/feh --bg-fill ${config.home.homeDirectory}/Pictures/wallpapers/jupiter.png"; + notification = false; + always = true; + } + { + command = "${pkgs.i3-gaps}/bin/i3-msg 'workspace 1; exec ${pkgs.firefox}/bin/firefox'"; + } + { + command = "${pkgs.i3-gaps}/bin/i3-msg 'workspace 2; exec ${pkgs.tdesktop}/bin/telegram-desktop'"; + } + #{ + # command = "${pkgs.i3-gaps}/bin/i3-msg 'workspace 2; exec ${pkgs.element-desktop}/bin/element-desktop'"; + #} + { + command = "${pkgs.systemd}/bin/systemctl --user restart polybar.service"; + notification = false; + always = true; + } + { + command = "${pkgs.autorandr}/bin/autorandr -c"; + notification = false; + always = true; + } + ]; + + workspaceOutputAssign = [ + { + output = "DP-1"; + workspace = "1"; + } + { + output = "DP-2"; + workspace = "10"; + } + ]; + + bars = []; + }; + }; +} diff --git a/home/platforms/fabian@posixlycorrect/gui/polybar.nix b/home/platforms/fabian@posixlycorrect/gui/polybar.nix new file mode 100644 index 0000000..c6bf6d2 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/gui/polybar.nix @@ -0,0 +1,459 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; { + services.polybar = { + enable = true; + package = pkgs.polybarFull; + script = '' + # Terminate already running bar instances + killall -q polybar + + # Wait until the processes have been shut down + while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + + # Launch Polybar, using default config location ~/.config/polybar/config + polybar -r main & polybar -r secondary & + ''; + + settings = { + "colors" = { + # background = "\${xrdb:color0:#222}"; + background = "#AA000000"; + background-alt = "#00000000"; + # foreground = "\${xrdb:color7:#222}"; + foreground = "#ffffff"; + foreground-alt = "#ffffff"; + primary = "#ffffff"; + secondary = "#e60053"; + alert = "#bd2c40"; + }; + + "bar/main" = { + monitor = "DP-1"; + width = "100%"; + height = 30; + offset-x = "0%"; + offset-y = "0%"; + radius = 0.0; + fixed-center = false; + + background = "\${colors.background}"; + foreground = "\${colors.foreground}"; + + line-size = 1; + line-color = "#f0000000"; + + border-size = 0; + border-color = "#00000000"; + + padding-left = 0; + padding-right = 0; + + module-margin-left = 1; + module-margin-right = 1; + + # font-0 = "fixed:pixelsize=10;1"; + font-0 = "JetBrains Mono Light:size=10;0"; + font-1 = "unifont:fontformat=truetype:size=8:antialias=false;0"; + font-2 = "siji:pixelsize=10;1"; + # font-2 = "FontAwesome5Free:style=Regular:size=10;4"; + + modules-left = "i3"; + modules-center = "xwindow"; + modules-right = "xkeyboard pulseaudio filesystem memory cpu temperature gputemperature nvmetemperature wlan eth date semanatec"; + separator = "|"; + + tray-position = "right"; + tray-padding = 2; + + # To allow other windows to be placed above the bar, or to avoid having the bar visible when in fullscreen mode, + # you need to use the following two parameters. Note that it will tell the window manager to back off so no + # area will be reserved, etc. + # + # wm-restack = "i3"; + # override-redirect = true; + + cursor-click = "pointer"; + cursor-scroll = "ns-resize"; + }; + + "bar/secondary" = { + monitor = "DP-2"; + "inherit" = "bar/main"; + + modules-left = "i3"; + modules-center = "xwindow"; + modules-right = "xkeyboard pulseaudio date"; + tray-position = "none"; + }; + + "module/xwindow" = { + type = "internal/xwindow"; + label = "%title:0:30:...%"; + }; + + "module/xkeyboard" = { + type = "internal/xkeyboard"; + blacklist-0 = "num lock"; + + format-prefix = ""; + format-prefix-foreground = "\${colors.foreground-alt}"; + + label-layout = "%layout%"; + + label-indicator-padding = 2; + label-indicator-margin = 1; + label-indicator-background = "\${colors.secondary}"; + }; + + "module/filesystem" = { + type = "internal/fs"; + interval = 10; + + mount-0 = "/"; + + label-mounted = "%{F#0a81f5}%mountpoint%%{F-}: %used%/%total%"; + label-unmounted = ""; + }; + + "module/i3" = { + type = "internal/i3"; + format = "<label-state> <label-mode>"; + index-sort = true; + wrapping-scroll = false; + + # Only show workspaces on the same output as the bar + # pin-workspaces = true + + label-mode-padding = 1; + label-mode-foreground = "#000"; + label-mode-background = "\${colors.primary}"; + + # focused = Active workspace on focused monitor + label-focused = "%index%"; + label-focused-background = "\${colors.background}"; + label-focused-underline = "\${colors.primary}"; + label-focused-padding = 1; + + # unfocused = Inactive workspace on any monitor + label-unfocused = "%index%"; + label-unfocused-padding = 1; + + # visible = Active workspace on unfocused monitor + label-visible = "%index%"; + label-visible-background = "\${self.label-focused-background}"; + label-visible-underline = "\${self.label-focused-underline}"; + label-visible-padding = "\${self.label-focused-padding}"; + + # urgent = Workspace with urgency hint set + label-urgent = "%index%"; + label-urgent-background = "\${colors.alert}"; + label-urgent-padding = 1; + }; + + "module/xbacklight" = { + type = "internal/xbacklight"; + + format = "<label> <bar>"; + label = "BL"; + + bar-width = 10; + bar-indicator = "|"; + bar-indicator-foreground = "#fff"; + bar-indicator-font = 2; + bar-fill = "─"; + bar-fill-font = 2; + bar-fill-foreground = "#9f78e1"; + bar-empty = "─"; + bar-empty-font = 2; + bar-empty-foreground = "\${colors.foreground-alt}"; + }; + + "module/backlight-acpi" = { + "inherit" = "module/xbacklight"; + type = "internal/backlight"; + card = "intel_backlight"; + }; + + "module/cpu" = { + type = "internal/cpu"; + interval = 2; + format-prefix = "cpu "; + format-prefix-foreground = "\${colors.foreground-alt}"; + label = "%percentage:2%%"; + }; + + "module/memory" = { + type = "internal/memory"; + interval = 2; + format-prefix = "mem "; + format-prefix-foreground = "\${colors.foreground-alt}"; + label = "%percentage_used%%"; + }; + + "module/wlan" = { + type = "internal/network"; + interface = "wlp7s0"; + interval = 3.0; + + format-connected = "<ramp-signal> <label-connected>"; + label-connected = "%essid%"; + + format-disconnected = ""; + # format-disconnected = "<label-disconnected>"; + # format-disconnected-underline = "\${self.format-connected-underline}"; + # label-disconnected = "%ifname% disconnected"; + # label-disconnected-foreground = "\${colors.foreground-alt}"; + + ramp-signal-0 = ""; + ramp-signal-1 = ""; + ramp-signal-2 = ""; + ramp-signal-3 = ""; + ramp-signal-4 = ""; + ramp-signal-foreground = "\${colors.foreground-alt}"; + }; + + "module/eth" = { + type = "internal/network"; + interface = "enp8s0"; + interval = 3.0; + + format-connected-prefix = ""; + format-connected-prefix-foreground = "\${colors.foreground-alt}"; + label-connected = "%local_ip%"; + + format-disconnected = ""; + # format-disconnected = "<label-disconnected>"; + # format-disconnected-underline = "\${self.format-connected-underline}"; + # label-disconnected = "%ifname% disconnected"; + # label-disconnected-foreground = "\${colors.foreground-alt}"; + }; + + "module/date" = { + type = "internal/date"; + interval = 1; + + date = " %d/%m/%Y"; + date-alt = " %c"; + + time = "%H:%M"; + time-alt = " [%s]"; + + format-prefix = ""; + format-prefix-foreground = "\${colors.foreground-alt}"; + + label = "%date% %time%"; + }; + + # "module/semanatec" = { + # type = "custom/script" + # exec = "/home/fabian/bin/semanatec/target/release/semanatec" + # interval = 3600 + # format-prefix = "" + # }; + + "module/pulseaudio" = { + type = "internal/pulseaudio"; + + format-volume = "<label-volume>"; + label-volume = "vol %percentage%%"; + label-volume-foreground = "\${root.foreground}"; + + label-muted = "vol 0%"; + label-muted-foreground = "\${root.foreground}"; + + bar-volume-width = 10; + bar-volume-foreground-0 = "#55aa55"; + bar-volume-foreground-1 = "#55aa55"; + bar-volume-foreground-2 = "#55aa55"; + bar-volume-foreground-3 = "#55aa55"; + bar-volume-foreground-4 = "#55aa55"; + bar-volume-foreground-5 = "#f5a70a"; + bar-volume-foreground-6 = "#ff5555"; + bar-volume-gradient = false; + bar-volume-indicator = "|"; + bar-volume-indicator-font = 2; + bar-volume-fill = "─"; + bar-volume-fill-font = 2; + bar-volume-empty = "─"; + bar-volume-empty-font = 2; + bar-volume-empty-foreground = "\${colors.foreground-alt}"; + }; + + "module/alsa" = { + type = "internal/alsa"; + + format-volume = "<label-volume> <bar-volume>"; + label-volume = "VOL"; + label-volume-foreground = "\${root.foreground}"; + + format-muted-prefix = "vol "; + format-muted-foreground = "\${colors.foreground-alt}"; + label-muted = "sound muted"; + + bar-volume-width = 10; + bar-volume-foreground-0 = "#55aa55"; + bar-volume-foreground-1 = "#55aa55"; + bar-volume-foreground-2 = "#55aa55"; + bar-volume-foreground-3 = "#55aa55"; + bar-volume-foreground-4 = "#55aa55"; + bar-volume-foreground-5 = "#f5a70a"; + bar-volume-foreground-6 = "#ff5555"; + bar-volume-gradient = false; + bar-volume-indicator = "|"; + bar-volume-indicator-font = 2; + bar-volume-fill = "─"; + bar-volume-fill-font = 2; + bar-volume-empty = "─"; + bar-volume-empty-font = 2; + bar-volume-empty-foreground = "\${colors.foreground-alt}"; + }; + + "module/battery" = { + type = "internal/battery"; + battery = "BAT0"; + adapter = "ADP1"; + full-at = 98; + + format-charging = "<animation-charging> <label-charging>"; + format-charging-underline = "#ffb52a"; + + format-discharging = "<animation-discharging> <label-discharging>"; + format-discharging-underline = "\${self.format-charging-underline}"; + + format-full-prefix = " "; + format-full-prefix-foreground = "\${colors.foreground-alt}"; + format-full-underline = "\${self.format-charging-underline}"; + + ramp-capacity-0 = ""; + ramp-capacity-1 = ""; + ramp-capacity-2 = ""; + ramp-capacity-foreground = "\${colors.foreground-alt}"; + + animation-charging-0 = ""; + animation-charging-1 = ""; + animation-charging-2 = ""; + animation-charging-foreground = "\${colors.foreground-alt}"; + animation-charging-framerate = 750; + + animation-discharging-0 = ""; + animation-discharging-1 = ""; + animation-discharging-2 = ""; + animation-discharging-foreground = "\${colors.foreground-alt}"; + animation-discharging-framerate = 750; + }; + + "module/temperature" = { + type = "internal/temperature"; + warn-temperature = 60; + hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon1/temp2_input"; + + format = "<ramp> <label>"; + format-warn = "<ramp> <label-warn>"; + + label = "cpu %temperature-c%"; + label-warn = "cpu %temperature-c%"; + label-warn-foreground = "\${colors.secondary}"; + + ramp-0 = ""; + ramp-1 = ""; + ramp-2 = ""; + ramp-foreground = "\${colors.foreground-alt}"; + }; + + "module/gputemperature" = { + type = "internal/temperature"; + warn-temperature = 60; + hwmon-path = "/sys/devices/pci0000:00/0000:00:03.1/0000:09:00.0/hwmon/hwmon3/temp1_input"; + + format = "<ramp> <label>"; + format-warn = "<ramp> <label-warn>"; + + label = "gpu %temperature-c%"; + label-warn = "gpu %temperature-c%"; + label-warn-foreground = "\${colors.secondary}"; + + ramp-0 = ""; + ramp-1 = ""; + ramp-2 = ""; + ramp-foreground = "\${colors.foreground-alt}"; + }; + + "module/nvmetemperature" = { + type = "internal/temperature"; + warn-temperature = 60; + hwmon-path = "/sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0/hwmon/hwmon0/temp1_input"; + + format = "<ramp> <label>"; + format-warn = "<ramp> <label-warn>"; + + label = "M.2 %temperature-c%"; + label-warn = "M.2 %temperature-c%"; + label-warn-foreground = "\${colors.secondary}"; + + ramp-0 = ""; + ramp-1 = ""; + ramp-2 = ""; + ramp-foreground = "\${colors.foreground-alt}"; + }; + + "module/powermenu" = { + type = "custom/menu"; + + expand-right = true; + + format-spacing = 1; + + label-open = ""; + label-open-foreground = "\${colors.secondary}"; + label-close = " cancel"; + label-close-foreground = "\${colors.secondary}"; + label-separator = "|"; + label-separator-foreground = "\${colors.foreground-alt}"; + + menu-0-0 = "reboot"; + menu-0-0-exec = "menu-open-1"; + menu-0-1 = "power off"; + menu-0-1-exec = "menu-open-2"; + + menu-1-0 = "cancel"; + menu-1-0-exec = "menu-open-0"; + menu-1-1 = "reboot"; + menu-1-1-exec = "sudo reboot"; + + menu-2-0 = "power off"; + menu-2-0-exec = "sudo poweroff"; + menu-2-1 = "cancel"; + menu-2-1-exec = "menu-open-0"; + }; + + "module/sink_changer" = { + type = "custom/script"; + exec = "/home/fabian/bin/polybar_scripts/info.sh"; + label = "%output%"; + click-left = "/home/fabian/bin/polybar_scripts/sink_changer.sh"; + # format-prefix = " "; + interval = "0"; + # format-prefix-foreground = "${colors.foreground-alt}"; + }; + + "settings" = { + screenchange-reload = true; + # compositing-background = "xor"; + # compositing-background = "screen"; + # compositing-foreground = "source"; + # compositing-border = "over"; + # pseudo-transparency = false; + }; + + "global/wm" = { + margin-top = 5; + margin-bottom = 5; + }; + }; + }; +} diff --git a/home/platforms/fabian@posixlycorrect/gui/startx.nix b/home/platforms/fabian@posixlycorrect/gui/startx.nix new file mode 100644 index 0000000..d19e317 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/gui/startx.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; { + xsession.enable = true; + + home.file.".xinitrc".source = let + content = '' + exec ~/.xsession + ''; + in + pkgs.writeShellScript "xinitrc" content; +} diff --git a/home/platforms/fabian@posixlycorrect/isolation.nix b/home/platforms/fabian@posixlycorrect/isolation.nix new file mode 100644 index 0000000..6a79337 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/isolation.nix @@ -0,0 +1,22 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; { + home.isolation = { + enable = true; + btrfsSupport = true; + defaults = { + static = true; + bindHome = "home/"; + persist = { + base = "shenvs"; + btrfs = true; + }; + }; + + modulesUnder = ./shenvs; + }; +} diff --git a/home/platforms/fabian@posixlycorrect/lib/default.nix b/home/platforms/fabian@posixlycorrect/lib/default.nix new file mode 100644 index 0000000..b00a0c7 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/lib/default.nix @@ -0,0 +1,52 @@ +{ + config, + lib, + pkgs, + ... +}: { + imports = [ + ./steam + ./terminal + ]; + + home.packages = with pkgs; [ + calc + chromium + darktable + deluge + discord + file + firefox + gcc + gperftools + gwenview + htop + killall + libreoffice-fresh + lutris + man-pages + man-pages-posix + mpv + neovim + obs-studio + openrct2 + pavucontrol + pdfarranger + prismlauncher + qpdfview + runelite + spotify + tdesktop + tree + units + unzip + usbutils + virt-manager + vlc + vpsfree-client + vscodium-fhs + zip + zola + zoom-us + ]; +} diff --git a/home/platforms/fabian@posixlycorrect/lib/steam/default.nix b/home/platforms/fabian@posixlycorrect/lib/steam/default.nix new file mode 100644 index 0000000..8ba18b9 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/lib/steam/default.nix @@ -0,0 +1,14 @@ +{ + pkgs, + lib, + config, + ... +}: +with lib; { + home.packages = [ + (pkgs.callPackage ./package.nix {}) + pkgs.protonup + pkgs.winetricks + pkgs.protontricks + ]; +} diff --git a/home/platforms/fabian@posixlycorrect/lib/steam/package.nix b/home/platforms/fabian@posixlycorrect/lib/steam/package.nix new file mode 100644 index 0000000..19f241f --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/lib/steam/package.nix @@ -0,0 +1,9 @@ +{ + writeShellScriptBin, + steam-run, + steam, + ... +}: +writeShellScriptBin "steam" '' + exec ${steam-run}/bin/steam-run ${steam}/bin/steam -console +'' diff --git a/home/platforms/fabian@posixlycorrect/lib/terminal/default.nix b/home/platforms/fabian@posixlycorrect/lib/terminal/default.nix new file mode 100644 index 0000000..a32486d --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/lib/terminal/default.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.local.apps.terminal; +in { + options.local.apps.terminal.enable = mkEnableOption "Terminal emulator settings"; + config.programs = mkIf cfg.enable { + kitty = { + enable = true; + extraConfig = import ./kitty.conf.nix; + }; + + tmux = { + enable = true; + aggressiveResize = true; + clock24 = true; + escapeTime = 10; + terminal = "xterm-256color"; + keyMode = "emacs"; + + extraConfig = '' + set -g mouse on + set -ga update-environment " LIFT_PID" + set -g set-titles on + set -g renumber-windows on + set -sa terminal-overrides ',xterm-termite:RGB' + set -g status-right "#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,} %H:%M %d-%b-%y" + ''; + }; + }; +} diff --git a/home/platforms/fabian@posixlycorrect/lib/terminal/kitty.conf.nix b/home/platforms/fabian@posixlycorrect/lib/terminal/kitty.conf.nix new file mode 100644 index 0000000..82904a9 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/lib/terminal/kitty.conf.nix @@ -0,0 +1,87 @@ +'' + # Fonts + font_family JetBrains Mono Medium + bold_font JetBrains Mono Bold + italic_font JetBrains Mono Italic + bold_italic_font JetBrains Mono Bold Italic + + font_size 15 + disable_ligatures cursor + + initial_window_width 1200 + initial_window_height 600 + + # Cursor + cursor_shape beam + cursor_beam_thickness 1.9 + cursor_stop_blinking_after 0 + + # Audio + enable_audio_bell no + + # Tabs + tab_bar_style separator + tab_separator " | " + tab_title_template "{index}: {title}" + + # Color + # special + foreground #ffffff + foreground_bold #ffffff + cursor #ffffff + background #000000 + background_opacity 1 + + # Shortcuts + map ctrl+shift+c copy_to_clipboard + map ctrl+shift+v paste_from_clipboard + map ctrl+shift+s paste_from_selection + map shift+insert paste_from_selection + + map ctrl+shift+up scroll_line_up + map ctrl+shift+down scroll_line_down + map ctrl+shift+page_up scroll_page_up + map ctrl+shift+page_down scroll_page_down + map ctrl+shift+home scroll_home + map ctrl+shift+end scroll_end + + map ctrl+shift+enter new_window + map ctrl+alt+enter launch --cwd=current + map ctrl+shift+w close_window + map ctrl+shift+] next_window + map ctrl+shift+[ previous_window + map ctrl+shift+1 first_window + map ctrl+shift+2 second_window + map ctrl+shift+3 third_window + map ctrl+shift+4 fourth_window + map ctrl+shift+5 fifth_window + map ctrl+shift+6 sixth_window + map ctrl+shift+7 seventh_window + map ctrl+shift+8 eighth_window + map ctrl+shift+9 ninth_window + map ctrl+shift+0 tenth_window + + map ctrl+shift+right next_tab + map ctrl+shift+left previous_tab + map ctrl+shift+t new_tab + map ctrl+shift+q close_tab + map ctrl+shift+. move_tab_forward + map ctrl+shift+, move_tab_backward + map ctrl+shift+alt+t set_tab_title + map ctrl+alt+1 goto_tab 1 + map ctrl+alt+2 goto_tab 2 + map ctrl+alt+3 goto_tab 3 + map ctrl+alt+4 goto_tab 4 + map ctrl+alt+5 goto_tab 5 + map ctrl+alt+6 goto_tab 6 + map ctrl+alt+7 goto_tab 7 + map ctrl+alt+8 goto_tab 8 + map ctrl+alt+9 goto_tab 9 + map ctrl+alt+0 goto_tab 10 + + map ctrl+shift+equal change_font_size all +1.0 + map ctrl+shift+minus change_font_size all -1.0 + map ctrl+shift+backspace change_font_size all 0 + + map ctrl+shift+delete clear_terminal reset active +'' diff --git a/home/platforms/fabian@posixlycorrect/shenvs/c.nix b/home/platforms/fabian@posixlycorrect/shenvs/c.nix new file mode 100644 index 0000000..0ce5ad7 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/shenvs/c.nix @@ -0,0 +1,13 @@ +{pkgs, ...}: { + static = true; + + packages = with pkgs; [ + binutils + cmake + curl + gdb + gnumake + rustup + valgrind + ]; +} diff --git a/home/platforms/fabian@posixlycorrect/shenvs/python.nix b/home/platforms/fabian@posixlycorrect/shenvs/python.nix new file mode 100644 index 0000000..4818ea5 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/shenvs/python.nix @@ -0,0 +1,11 @@ +{pkgs, ...}: { + static = true; + + packages = with pkgs; [ + pipenv + (python310.withPackages (packages: + with packages; [ + setuptools + ])) + ]; +} diff --git a/home/platforms/fabian@posixlycorrect/systemd/default.nix b/home/platforms/fabian@posixlycorrect/systemd/default.nix new file mode 100644 index 0000000..83d75a8 --- /dev/null +++ b/home/platforms/fabian@posixlycorrect/systemd/default.nix @@ -0,0 +1,10 @@ +{ + lib, + pkgs, + ... +}: +with lib; { + systemd.user.tmpfiles.rules = [ + "d %t/tmp 0700 fabian fabian 24h" + ]; +} diff --git a/home/zshrc.nix b/home/zshrc.nix new file mode 100644 index 0000000..2bcee01 --- /dev/null +++ b/home/zshrc.nix @@ -0,0 +1,136 @@ +{ + maim, + redshift, + xclip, + ... +}: '' + # The following lines were added by compinstall + + zstyle ':completion:*' auto-description 'specify: %d' + zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate + zstyle ':completion:*' expand prefix suffix + zstyle ':completion:*' ignore-parents parent + zstyle ':completion:*' insert-unambiguous true + zstyle ':completion:*' list-colors "" + zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s + zstyle ':completion:*' list-suffixes true + zstyle ':completion:*' matcher-list "" 'm:{[:lower:]}={[:upper:]} m:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=** l:|=*' + zstyle ':completion:*' menu select=1 + zstyle ':completion:*' original true + zstyle ':completion:*' preserve-prefix '//[^/]##/' + zstyle ':completion:*' verbose true + zstyle :compinstall filename '/home/fabian/.zshrc' + + autoload -Uz compinit + compinit + # End of lines added by compinstall + # Lines configured by zsh-newuser-install + HISTFILE=~/.histfile + HISTSIZE=1000 + SAVEHIST=1000 + setopt autocd extendedglob nomatch + unsetopt beep notify + bindkey -v + # End of lines configured by zsh-newuser-install + + # Prompt + setopt prompt_subst + autoload -Uz vcs_info + precmd_vcs_info() { vcs_info } + precmd_functions+=( precmd_vcs_info ) + + zstyle ':vcs_info:*' disable bzr cdv darcs mtn svk tla cvs svn + zstyle ':vcs_info:*' enable git + zstyle ':vcs_info:git+set-message:*' hooks format_msg + + function +vi-format_msg { + local branch=$(git branch --show-current) + + if [[ -z "$branch" ]] ; then + branch=$(git rev-parse --short HEAD) + fi + + local color="" + + if [[ -z $(git status --porcelain 2>/dev/null) ]]; + then + color="%F{blue}" + fi + + if [[ $(git status --porcelain 2>/dev/null | grep "^A \|^M " | wc -l) > 0 ]]; + then + color="%F{green}" + fi + + if [[ $(git status --porcelain 2>/dev/null | grep "^??\|^AM\|^.D" | wc -l) > 0 ]] + then + color="%F{red}" + fi + + ret=1 + hook_com[message]="$color($branch)%f " + + return 0 + } + + PROMPT='%B[%~] ''${vcs_info_msg_0_}%b' + + # Aliases and binds + alias ls='ls --color -F' + alias l='ls --color -FhAltr' + alias x='killall --ignore-case --user=$(whoami) --interactive' + alias sc='${maim}/bin/maim -s -u | ${xclip}/bin/xclip -selection clipboard -t image/png -i' + alias tree='tree -CF' + alias lock="betterlockscreen -l" + alias nightmode="${redshift}/bin/redshift -P -O 1000" + alias lightmode="${redshift}/bin/redshift -P -O 6500" + alias inbox="echo >> $HOME/gtd/inbox" + alias nixoide="nix repl '<nixpkgs>'" + alias vps="ssh -A vps" + bindkey -e + bindkey ";5D" backward-word + bindkey ";5C" forward-word + bindkey "\e[3~" delete-char + + function use() { + local pkg + pkg="$1" + shift + echo "nix shell nixpkgs#$pkg" + nix shell "nixpkgs#$pkg" "$@" + } + + function unuse() { + local pkg + pkg="$1" + shift + echo "nix shell unstable#$pkg --impure" + nix shell "unstable#$pkg" "$@" --impure + } + + function spawn () { + if [ ! -x "$(command -v $1)" ] + then + echo "spawn: no such program: $1" >&2 + return 1 + fi + $@ > /dev/null 0>&1 2>&1 & + disown + } + + autoload -Uz up-line-or-beginning-search + zle -N up-line-or-beginning-search + autoload -Uz down-line-or-beginning-search + zle -N down-line-or-beginning-search + bindkey '\eOA' up-line-or-beginning-search + bindkey '\e[A' up-line-or-beginning-search + bindkey '\eOB' down-line-or-beginning-search + bindkey '\e[B' down-line-or-beginning-search + + # Env + export TERM=xterm-256color + export EDITOR=nvim + export VISUAL=nvim + export PATH="$PATH:$HOME/.local/bin:$HOME/.cargo/bin" + export NIXPKGS_ALLOW_UNFREE=1 +'' diff --git a/pkgs/config/default.nix b/pkgs/config/default.nix index 395d35d..0156348 100644 --- a/pkgs/config/default.nix +++ b/pkgs/config/default.nix @@ -1,5 +1,5 @@ lib: with lib; { - android_sdk.accept_license = true; + android_sdk.accept_license = true; #TODO: what the fuck is this allowUnfreePredicate = pkg: import ./unfree.nix lib (getName pkg); } diff --git a/pkgs/config/unfree.nix b/pkgs/config/unfree.nix index a4f1b5c..c53524e 100644 --- a/pkgs/config/unfree.nix +++ b/pkgs/config/unfree.nix @@ -2,12 +2,10 @@ lib: name: with lib; elem name [ "discord" - "rar" "spotify" "spotify-unwrapped" "steam" "steam-original" "steam-run" - "teams" "zoom" ] diff --git a/sys/default.nix b/sys/default.nix new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/sys/default.nix @@ -0,0 +1 @@ +{} diff --git a/sys/platforms/posixlycorrect/default.nix b/sys/platforms/posixlycorrect/default.nix new file mode 100644 index 0000000..f67ae8c --- /dev/null +++ b/sys/platforms/posixlycorrect/default.nix @@ -0,0 +1,104 @@ +# Edet this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + config, + pkgs, + lib, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.tmp.useTmpfs = true; + boot.kernelPackages = pkgs.linuxPackages_latest; + + networking.hostName = "posixlycorrect"; + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/Costa_Rica"; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.enp7s0.useDHCP = true; + networking.interfaces.wlp6s0.useDHCP = true; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + + # Enable the X11 windowing system. + services.xserver = { + enable = true; + xkb.layout = "us"; + displayManager.startx.enable = true; + }; + services.libinput.enable = true; + + hardware.opengl.enable = true; + + # Enable sound. + sound.enable = true; + hardware.pulseaudio.enable = true; + + programs.zsh.enable = true; + environment.pathsToLink = ["/share/zsh"]; + + users = { + users.fabian = { + isNormalUser = true; + uid = 1002; # nunca cambiar mi ID de usuario + group = "fabian"; + shell = pkgs.zsh; + extraGroups = ["users" "wheel" "networkmanager" "dialout" "libvirtd"]; + }; + groups.fabian.gid = 1002; + }; + + services.udev.packages = [ + pkgs.android-udev-rules + ]; + + users.users.temp = { + isNormalUser = true; + extraGroups = ["wheel"]; + }; + + virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm; + virtualisation.libvirtd.qemu.ovmf.enable = true; + virtualisation.libvirtd.qemu.ovmf.packages = [pkgs.OVMFFull.fd]; + virtualisation.libvirtd.enable = true; + programs.dconf.enable = true; + # boot.kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ]; + # boot.kernelParams = [ "amd_iommu=on" "iommu=pt" "vfio-pci.ids=1002:699f,1002:aae0" "video=efifb:off" ]; + virtualisation.libvirtd.onBoot = "start"; + + nix = { + package = pkgs.nixFlakes; + extraOptions = '' + experimental-features = nix-command flakes repl-flake + ''; + }; + + hardware.opengl.driSupport32Bit = true; + + services.openssh.enable = true; + + services.earlyoom = { + enable = true; + enableNotifications = true; + }; + + system.stateVersion = "21.11"; # No tocar esto +} diff --git a/sys/platforms/posixlycorrect/hardware-configuration.nix b/sys/platforms/posixlycorrect/hardware-configuration.nix new file mode 100644 index 0000000..a9feac6 --- /dev/null +++ b/sys/platforms/posixlycorrect/hardware-configuration.nix @@ -0,0 +1,43 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: let + subvol = subvol: { + device = "/dev/disk/by-uuid/645fdba0-5c03-4285-926b-facded1ee259"; + fsType = "btrfs"; + options = ["subvol=${subvol}" "compress=zstd" "noatime" "ssd"]; + }; +in { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd = { + availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; + luks.devices."toplevel" = { + device = "/dev/disk/by-uuid/58277baa-90d4-4a5e-a658-1b918b89130a"; + preLVM = false; + }; + }; + + fileSystems = { + "/" = subvol "root"; + "/toplevel" = subvol "/"; + "/boot" = { + device = "/dev/disk/by-uuid/B007-B007"; + fsType = "vfat"; + options = ["umask=027"]; + }; + + "/extern" = { + device = "/dev/disk/by-uuid/7d8d3ec9-b456-4e2a-9396-551dcaf7705b"; + fsType = "btrfs"; + options = ["noatime" "compress=zstd"]; + }; + }; + + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}