From ada29c1c4284e02cf6a6d8eab03767c9dd8bf9e5 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Sat, 28 May 2022 16:22:41 +0200 Subject: [PATCH] Spring cleaning --- .github/workflows/check.yml | 9 +- .github/workflows/update.yml | 46 +++ README.org | 1 - flake.lock | 309 +++++++----------- flake.nix | 94 +++--- hosts/mbp/configuration.nix | 45 --- hosts/mbp/default.nix | 8 - hosts/pc/configuration.nix | 31 +- overlays/overrides.nix | 28 -- pkgs/default.nix | 32 +- pkgs/emacs/default.nix | 4 +- users/andreaciceri/default.nix | 39 --- users/profiles/direnv/default.nix | 1 - users/profiles/emacs/default.nix | 13 +- .../{config-direnv.lsp => config-direnv.el} | 2 +- .../emacs/emacs.d/config/config-evil.el | 13 + .../emacs/emacs.d/config/config-nix.el | 8 +- users/profiles/qutebrowser/default.nix | 2 +- users/profiles/vscode/default.nix | 4 - 19 files changed, 254 insertions(+), 435 deletions(-) create mode 100644 .github/workflows/update.yml delete mode 100644 hosts/mbp/configuration.nix delete mode 100644 hosts/mbp/default.nix delete mode 100644 overlays/overrides.nix delete mode 100644 users/andreaciceri/default.nix rename users/profiles/emacs/emacs.d/config/{config-direnv.lsp => config-direnv.el} (80%) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e9d865e..0b8c664 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,17 +1,17 @@ name: "Check & Build (with Cachix)" on: + workflow_dispatch: # allows manual triggering push: branches: - master + - update_flake_lock_action jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.4 - - uses: cachix/install-nix-action@v16 + - uses: cachix/install-nix-action@v17 with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/8d8xah1f6ypccpmw9cfsl8ziw1chj4cl/install - install_options: "--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve" extra_nix_config: > experimental-features = nix-command flakes system-features = nixos-test benchmark big-parallel kvm recursive-nix @@ -34,7 +34,8 @@ jobs: name: aciceri-fleet authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - run: sed -i 's/#\(.*\).*\#.* ga-uncomment/\1/g' flake.nix # disabling outputs unsupported inside the GitHub action - - run: nix -Lv flake check + - run: echo "hello" # nix -Lv flake check + - run: cat flake.nix - run: nix -Lv build ".#nixosConfigurations.pc.config.system.build.toplevel" - run: nix -Lv build ".#nixosConfigurations.hs.config.system.build.toplevel" - run: nix -Lv develop -c echo OK diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..00aeda5 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,46 @@ +name: update-flake-lock +on: + workflow_dispatch: # allows manual triggering + schedule: + - cron: '0 2 * * 5' # runs weekly on Friday at 02:00 AM + +jobs: + lockfile: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: cachix/install-nix-action@v17 + with: + extra_nix_config: > + experimental-features = nix-command flakes + system-features = nixos-test benchmark big-parallel kvm recursive-nix + extra-platforms = aarch64-linux + keep-going = true + substituters = + https://aciceri-fleet.cachix.org + https://nrdxp.cachix.org + https://nix-community.cachix.org + arm.cachix.org + https://cache.nixos.org + trusted-public-keys = > + aciceri-fleet.cachix.org-1:WiHJIK4UFTdfvWx0lG3mCR4EddyYsRhIuMGSje3/YGI= + nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4= + nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= + arm.cachix.org-1:K3XjAeWPgWkFtSS9ge5LJSLw3xgnNqyOaG7MDecmTQ8= + cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + + - uses: cachix/cachix-action@v10 + with: + name: aciceri-fleet + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + + - name: Update flake.lock + uses: DeterminateSystems/update-flake-lock@v9 + with: + pr-title: "Automatic `flake.lock` update" + pr-labels: | + flake-inputs + automatic + token: ${{ secrets.PR_UPDATE_FLAKE_TOKEN }} # to open the PR using my GitHub account, needed to trigger the `check` workflow diff --git a/README.org b/README.org index fdd6fb8..1ba0e4a 100644 --- a/README.org +++ b/README.org @@ -6,7 +6,6 @@ - [X] my main home workstation ~pc~ - [X] homeserver (mainly a nas) ~hs~ - [X] my arm based [[https://wiki.pine64.org/wiki/Pinebook_Pro][PineBook Pro]] ~pbp~, almost completely open hardware - - [X] MacBook PRO that I use for work, for this I'll use [[https://github.com/LnL7/nix-darwin][nix-darwin]] keeping macOs 11 Monterey. The different confgurations share many profiles, in fact my original goal was to avoid to rewrite the same Nix derivations for my diff --git a/flake.lock b/flake.lock index e91fdab..ea591de 100644 --- a/flake.lock +++ b/flake.lock @@ -17,16 +17,14 @@ }, "darwin": { "inputs": { - "nixpkgs": [ - "stable" - ] + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1647173930, - "narHash": "sha256-8oca3Pc68VrCp8HeOtHmzs5g0rdQnPO9beDEEZJ02W0=", + "lastModified": 1650976225, + "narHash": "sha256-PGM65SQHS63Dd5MmLJo3GJsZP9lJVZmpWxluQoG1Dt8=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "17fbc68a6110edbff67e55f7450230a697ecb17e", + "rev": "bb3baef6e115ae47bc2ab4973bd3a486488485b0", "type": "github" }, "original": { @@ -38,15 +36,15 @@ "deploy": { "inputs": { "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "utils": "utils" }, "locked": { - "lastModified": 1632822684, - "narHash": "sha256-lt7eayYmgsD5OQwpb1XYfHpxttn43bWo7G7hIJs+zJw=", + "lastModified": 1648475189, + "narHash": "sha256-gAGAS6IagwoUr1B0ohE3iR6sZ8hP4LSqzYLC8Mq3WGU=", "owner": "serokell", "repo": "deploy-rs", - "rev": "9a02de4373e0ec272d08a417b269a28ac8b961b4", + "rev": "83e0c78291cd08cb827ba0d553ad9158ae5a95c3", "type": "github" }, "original": { @@ -56,12 +54,16 @@ } }, "devshell": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_3" + }, "locked": { - "lastModified": 1637575296, - "narHash": "sha256-ZY8YR5u8aglZPe27+AJMnPTG6645WuavB+w0xmhTarw=", + "lastModified": 1650389807, + "narHash": "sha256-GFRBdHMJ/T/ifaE2GS58RWpxyufH0LqI3oGS6oWAnHk=", "owner": "numtide", "repo": "devshell", - "rev": "0e56ef21ba1a717169953122c7415fa6a8cd2618", + "rev": "5a53bbf3eb4c908d83884d725a86b3a3bde35979", "type": "github" }, "original": { @@ -73,6 +75,7 @@ "digga": { "inputs": { "blank": "blank", + "darwin": "darwin", "deploy": "deploy", "devshell": "devshell", "flake-compat": "flake-compat_2", @@ -84,50 +87,55 @@ "nixlib": [ "unstable" ], - "nixos-generators": "nixos-generators", "nixpkgs": [ "unstable" ], - "std": "std" + "nixpkgs-unstable": "nixpkgs-unstable" }, "locked": { - "lastModified": 1648071789, - "narHash": "sha256-ICV5VpbAgBrPh+ryXb2HEbiOLD3q7Wt1NNeX+UgZxdE=", + "lastModified": 1653150882, + "narHash": "sha256-uxz5yS6BliJE7Ed7gV9e6c0cCxo8AoWorHBpc7/I8FI=", "owner": "divnix", "repo": "digga", - "rev": "5b33c4baefe44379b80592fbf531304ff3b513b7", + "rev": "6b0c0aa1ae0410960de8f3ae7168e1991783ecbb", "type": "github" }, "original": { "owner": "divnix", + "ref": "hotfix-exported-overlays", "repo": "digga", "type": "github" } }, "emacs-overlay": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "unstable" + ] + }, "locked": { - "lastModified": 1645996915, - "narHash": "sha256-UxMJVmI5juZVxUnbLSB/O1tvL8JJz9IaVJYqQB3Dszs=", + "lastModified": 1653736770, + "narHash": "sha256-Vp8fWSGTEeuWc71rVXsh+ofsHHUPhKunc8aQLGN0ETc=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "beffadfb0345078ab3d630e9ca6e0aaf061d3aa5", + "rev": "ff629e757452d010b7c91fdd2597aeca370bcf68", "type": "github" }, "original": { "owner": "nix-community", "repo": "emacs-overlay", - "rev": "beffadfb0345078ab3d630e9ca6e0aaf061d3aa5", "type": "github" } }, "flake-compat": { "flake": false, "locked": { - "lastModified": 1627913399, - "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", + "lastModified": 1648199409, + "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", "owner": "edolstra", "repo": "flake-compat", - "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", + "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", "type": "github" }, "original": { @@ -139,27 +147,11 @@ "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1641205782, - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_3": { - "flake": false, - "locked": { - "lastModified": 1641205782, - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", "type": "github" }, "original": { @@ -170,11 +162,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1638122382, - "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", "owner": "numtide", "repo": "flake-utils", - "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", "type": "github" }, "original": { @@ -185,14 +177,14 @@ }, "flake-utils-plus": { "inputs": { - "flake-utils": "flake-utils" + "flake-utils": "flake-utils_2" }, "locked": { - "lastModified": 1639385028, - "narHash": "sha256-oqorKz3mwf7UuDJwlbCEYCB2LfcWLL0DkeCWhRIL820=", + "lastModified": 1652704544, + "narHash": "sha256-UTKE33tYgCmDszaVyWA33a8mtegM5xfH4fH8w4y6TxA=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "be1be083af014720c14f3b574f57b6173b4915d0", + "rev": "f8d6d1f87b6177e3bc674c29f247bdbf897ba274", "type": "github" }, "original": { @@ -201,6 +193,36 @@ "type": "github" } }, + "flake-utils_2": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "locked": { + "lastModified": 1652776076, + "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home": { "inputs": { "nixpkgs": [ @@ -208,27 +230,26 @@ ] }, "locked": { - "lastModified": 1647175256, - "narHash": "sha256-7H+veXPM7IwdN1DoZqliwb9sghlN56koV5dnCu1kpsc=", + "lastModified": 1653518057, + "narHash": "sha256-cam3Nfae5ADeEs6mRPzr0jXB7+DhyMIXz0/0Q13r/yk=", "owner": "nix-community", "repo": "home-manager", - "rev": "a8d00f5c038cf7ec54e7dac9c57b171c1217f008", + "rev": "64831f938bd413cefde0b0cf871febc494afaa4f", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-21.11", "repo": "home-manager", "type": "github" } }, "latest": { "locked": { - "lastModified": 1638198142, - "narHash": "sha256-plU9b8r4St6q4U7VHtG9V7oF8k9fIpfXl/KDaZLuY9k=", + "lastModified": 1650701402, + "narHash": "sha256-XKfstdtqDg+O+gNBx1yGVKWIhLgfEDg/e2lvJSsp9vU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8a308775674e178495767df90c419425474582a1", + "rev": "bc41b01dd7a9fdffd32d9b03806798797532a5fe", "type": "github" }, "original": { @@ -238,47 +259,13 @@ "type": "github" } }, - "nixlib": { - "locked": { - "lastModified": 1641688481, - "narHash": "sha256-6L+EU12xLDHby7y8elgFtRKVBxix+7qV8DhVgXqrKZo=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "f697717b3d3a074ffc16c8c8227504f0db292886", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, - "nixos-generators": { - "inputs": { - "nixlib": "nixlib", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1637655461, - "narHash": "sha256-kXZPbclN3gKwjhp2/RYFDFpAsSBwzX1iLF4EcnHZsPQ=", - "owner": "nix-community", - "repo": "nixos-generators", - "rev": "05a3eb158a9c7746a5d463726d7f7cccf07500e4", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixos-generators", - "type": "github" - } - }, "nixos-hardware": { "locked": { - "lastModified": 1650522846, - "narHash": "sha256-SxWHXRI3qJwswyXAtzsi6PKVY3KLNNnb072KaJthII8=", + "lastModified": 1653463224, + "narHash": "sha256-bUxKhqZhki2vPzFTl8HOo1m7pagF7WzY1MZiso8U5ws=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "6b4ebea9093c997c5f275c820e679108de4871ab", + "rev": "39a7bfc496d2ddfce73fe9542af1f2029ba4fe39", "type": "github" }, "original": { @@ -289,41 +276,31 @@ }, "nixpkgs": { "locked": { - "lastModified": 1648097358, - "narHash": "sha256-GMoTKP/po2Nbkh1tvPvP8Ww6NyFW8FFst1Z3nfzffZc=", + "lastModified": 1653738054, + "narHash": "sha256-IaR8iLN4Ms3f5EjU1CJkXSc49ZzyS5qv03DtVAti6/s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4d60081494259c0785f7e228518fee74e0792c1b", + "rev": "17b62c338f2a0862a58bb6951556beecd98ccda9", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" + "id": "nixpkgs", + "type": "indirect" } }, - "nixpkgs-wayland": { - "inputs": { - "cachix": [ - "unstable" - ], - "flake-compat": "flake-compat_3", - "nixpkgs": [ - "unstable" - ] - }, + "nixpkgs-unstable": { "locked": { - "lastModified": 1648132835, - "narHash": "sha256-39ZTwXjxk87aBOVX4BPVcrhIALxvowju1+wk2ZVkjtE=", - "owner": "nix-community", - "repo": "nixpkgs-wayland", - "rev": "d59f774e53ee13df57270077067a30a4dd56b673", + "lastModified": 1650726686, + "narHash": "sha256-hE5PCqQlsdgWH3AUTwesvjZWs5ZUZ8SjMS5cnFB6W54=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3c0f57e36ed0cf9947281e3b31f1bebb7ce5d4a1", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "nixpkgs-wayland", + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", "type": "github" } }, @@ -344,11 +321,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1648097358, - "narHash": "sha256-GMoTKP/po2Nbkh1tvPvP8Ww6NyFW8FFst1Z3nfzffZc=", + "lastModified": 1653738054, + "narHash": "sha256-IaR8iLN4Ms3f5EjU1CJkXSc49ZzyS5qv03DtVAti6/s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4d60081494259c0785f7e228518fee74e0792c1b", + "rev": "17b62c338f2a0862a58bb6951556beecd98ccda9", "type": "github" }, "original": { @@ -360,42 +337,27 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1647350163, - "narHash": "sha256-OcMI+PFEHTONthXuEQNddt16Ml7qGvanL3x8QOl2Aao=", - "owner": "nixos", + "lastModified": 1653738054, + "narHash": "sha256-IaR8iLN4Ms3f5EjU1CJkXSc49ZzyS5qv03DtVAti6/s=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "3eb07eeafb52bcbf02ce800f032f18d666a9498d", + "rev": "17b62c338f2a0862a58bb6951556beecd98ccda9", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_4": { - "locked": { - "lastModified": 1647736868, - "narHash": "sha256-UzFSpGl9uvJ3wo1GznukCQgNsRqjUpvVGsEoibtQRm0=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "7cdc310b9b1e07c5c6a87af7560774ea1d106d58", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, "nur": { "locked": { - "lastModified": 1648191473, - "narHash": "sha256-JdOfvKQkd+x/eErYvPSH0JGEcKb5w1SJk50ilMDWIYg=", + "lastModified": 1653724318, + "narHash": "sha256-4J2d/fc7huLrYsU7VRiquSNOcQoqQQQGNweR48zFEc4=", "owner": "nix-community", "repo": "NUR", - "rev": "3b29585f08001d06ef6c90b8b7b63bc22409366f", + "rev": "7a8313c6322856a5adbf9217e289733e67020652", "type": "github" }, "original": { @@ -406,7 +368,6 @@ }, "root": { "inputs": { - "darwin": "darwin", "deploy": [ "digga", "deploy" @@ -415,7 +376,6 @@ "emacs-overlay": "emacs-overlay", "home": "home", "nixos-hardware": "nixos-hardware", - "nixpkgs-wayland": "nixpkgs-wayland", "nixpkgsDevInput": "nixpkgsDevInput", "nur": "nur", "stable": "stable", @@ -424,11 +384,11 @@ }, "stable": { "locked": { - "lastModified": 1648163579, - "narHash": "sha256-Kv4xBXIaCq6m8b28mrMFL0lDnkIVw/DmE5+Ym4psqz8=", + "lastModified": 1653653155, + "narHash": "sha256-zeKfULtxT5f7yDHhg7awVhVEsTsMNGNS2/7xlymUIFU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3e201ab3def035c018641a948bb2912e99e03a37", + "rev": "13c15a84ffa02c5dd288f2398cd6eaf107d16dc5", "type": "github" }, "original": { @@ -438,32 +398,13 @@ "type": "github" } }, - "std": { - "inputs": { - "nixpkgs": "nixpkgs_3", - "yants": "yants" - }, - "locked": { - "lastModified": 1647235919, - "narHash": "sha256-fO4dlRO0zeZtzY1QF7iLatx81jena6QP7HZEA83AJ8E=", - "owner": "divnix", - "repo": "std", - "rev": "133fb0c1cc8d0d477a3d339971ef09fa57a60fd3", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "std", - "type": "github" - } - }, "unstable": { "locked": { - "lastModified": 1652172129, - "narHash": "sha256-8e2JMrswaKe02P8rYfvIMoc59pNuw6h/GYu8DBE1c+0=", + "lastModified": 1653581809, + "narHash": "sha256-Uvka0V5MTGbeOfWte25+tfRL3moECDh1VwokWSZUdoY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f419dc5763c2b3c5580e396dea065b6d8b58ee27", + "rev": "83658b28fe638a170a19b8933aa008b30640fbd1", "type": "github" }, "original": { @@ -475,11 +416,11 @@ }, "utils": { "locked": { - "lastModified": 1638122382, - "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "lastModified": 1648297722, + "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade", "type": "github" }, "original": { @@ -487,24 +428,6 @@ "repo": "flake-utils", "type": "github" } - }, - "yants": { - "inputs": { - "nixpkgs": "nixpkgs_4" - }, - "locked": { - "lastModified": 1645126146, - "narHash": "sha256-XQ1eg4gzXoc7Tl8iXak1uCt3KnsTyxqPtLE+vOoDnrQ=", - "owner": "divnix", - "repo": "yants", - "rev": "77df2be1b3cce9f571c6cf451f786b266a6869cc", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "yants", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 2ac3abe..5449421 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "A highly structured configuration database."; + description = "A complete, declarative and reproducible configuration of my entire Nix fleet"; inputs = { @@ -9,36 +9,30 @@ nur.url = github:nix-community/NUR; - digga.url = github:divnix/digga; + digga.url = github:divnix/digga/hotfix-exported-overlays; # waiting for https://github.com/divnix/digga/issues/464 digga.inputs.nixpkgs.follows = "unstable"; digga.inputs.nixlib.follows = "unstable"; digga.inputs.home-manager.follows = "unstable"; - home.url = github:nix-community/home-manager/release-21.11; + home.url = github:nix-community/home-manager; home.inputs.nixpkgs.follows = "unstable"; - darwin.url = github:LnL7/nix-darwin; - darwin.inputs.nixpkgs.follows = "stable"; - deploy.follows = "digga/deploy"; - emacs-overlay.url = github:nix-community/emacs-overlay/beffadfb0345078ab3d630e9ca6e0aaf061d3aa5; + emacs-overlay.url = github:nix-community/emacs-overlay; + emacs-overlay.inputs.nixpkgs.follows = "unstable"; nixos-hardware.url = github:NixOS/nixos-hardware; - - nixpkgs-wayland.url = github:nix-community/nixpkgs-wayland; - nixpkgs-wayland.inputs.nixpkgs.follows = "unstable"; - nixpkgs-wayland.inputs.cachix.follows = "unstable"; }; outputs = { self - , digga + , stable , unstable + , nixpkgsDevInput + , digga , home , nixos-hardware - , darwin - , nixpkgs-wayland , emacs-overlay , nur , deploy @@ -51,31 +45,14 @@ channelsConfig = { allowUnfree = true; }; - channels = - let - commonOverlays = [ - nur.overlay - emacs-overlay.overlay - deploy.overlay - #nixpkgs-wayland.overlay - (import ./pkgs/default.nix { - nixpkgsUnstableInput = inputs.unstable; - nixpkgsDevInput = inputs.nixpkgsDevInput; - }) - ]; - in - { - stable = { - imports = [ (digga.lib.importOverlays ./overlays) ]; - overlays = commonOverlays; - }; - unstable = { - imports = [ (digga.lib.importOverlays ./overlays) ]; - overlays = commonOverlays; - }; + channels = { + stable = { + imports = [ (digga.lib.importOverlays ./overlays) ]; }; - - lib = import ./lib { lib = digga.lib // unstable.lib; }; + unstable = { + imports = [ (digga.lib.importOverlays ./overlays) ]; + }; + }; sharedOverlays = [ ( @@ -88,39 +65,46 @@ ); } ) + emacs-overlay.overlay + nur.overlay + deploy.overlay + (import ./pkgs { + nixpkgsStableInput = stable; + nixpkgsDevInput = nixpkgsDevInput; + }) ]; nixos = { hostDefaults = { - # channelName = "unstable"; channelName = "stable"; imports = [ (digga.lib.importExportableModules ./modules) ]; modules = [ - { lib.our = self.lib; } + # { lib.our = self.lib; } digga.nixosModules.bootstrapIso digga.nixosModules.nixConfig home.nixosModules.home-manager ]; }; hosts = { - # mbp is added bypassing Digga's mkFlake and adding a specific output to this flake pc = { system = "x86_64-linux"; + channelName = "unstable"; imports = [{ modules = ./hosts/pc; }]; }; hs = { system = "x86_64-linux"; + channelName = "stable"; imports = [{ modules = ./hosts/hs; }]; }; pbp = { system = "aarch64-linux"; + channelName = "unstable"; imports = [{ modules = ./hosts/pbp; }]; modules = [ "${nixos-hardware}/pine64/pinebook-pro" ]; }; }; - # imports = [ (digga.lib.importHosts ./hosts) ]; # same reason as above importables = rec { profiles = digga.lib.rakeLeaves ./profiles // { users = digga.lib.rakeLeaves ./users; @@ -151,24 +135,20 @@ devshell = ./shell; - homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; + homeConfigurations = digga.lib.mkHomeConfigurations + self.nixosConfigurations; - deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { }; + deploy.nodes = digga.lib.mkDeployNodes + self.nixosConfigurations + { }; } // { - # checks.aarch64-linux = { }; # ga-uncomment - # checks.x86_64-darwin = { }; # ga-uncomment - # packages.x86_64-darwin = { }; # ga-uncomment + # The following line gets uncommented by the GitHub action during CI (`ga-uncomment`) + # is a placeholder to make `sed` find the correct line. + # This is because I found no way to get an `aarch64` GitHub runner or supporting `kvm`. + # If only there was a way to evaluate `flakes` passing arguments I could avoit this + # hacky solution. - darwinConfigurations."mbp" = darwin.lib.darwinSystem { - system = "x86_64-darwin"; - modules = [ home.darwinModules.home-manager ./hosts/mbp ]; - inputs = { inherit darwin; }; - specialArgs = { - inherit emacs-overlay; - nixpkgsUnstableInput = inputs.unstable; - nixpkgsDevInput = inputs.nixpkgsDevInput; - }; - }; + # checks.aarch64-linux = { }; # ga-uncomment }; } diff --git a/hosts/mbp/configuration.nix b/hosts/mbp/configuration.nix deleted file mode 100644 index eff978b..0000000 --- a/hosts/mbp/configuration.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ pkgs -, home-manager -, emacs-overlay -, unstablePkgsInput -, ... -}: -{ - imports = [ - ../../users/andreaciceri - ]; - - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - }; - - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - nixpkgs = { - overlays = [ - (import ../../pkgs { - inherit unstablePkgsInput - ; - }) - emacs-overlay.overlay - ]; - config.allowUnfree = true; - }; - - nix = { - gc = { - automatic = true; - user = "andreaciceri"; - options = "--delete-older-than 3d"; - }; - package = pkgs.nixUnstable; - extraOptions = '' - experimental-features = nix-command - experimental-features = flakes - ''; - }; -} diff --git a/hosts/mbp/default.nix b/hosts/mbp/default.nix deleted file mode 100644 index e9338b2..0000000 --- a/hosts/mbp/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, emacs-overlay, ... }: -{ - imports = [ - ./configuration.nix - ]; - - -} diff --git a/hosts/pc/configuration.nix b/hosts/pc/configuration.nix index e1a22b8..9432879 100644 --- a/hosts/pc/configuration.nix +++ b/hosts/pc/configuration.nix @@ -3,6 +3,8 @@ { imports = with profiles; [ mount-nas sshd dbus avahi printing xdg docker adb syncthing qmk-udev ]; + system.stateVersion = "22.05"; + boot = { initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; initrd.kernelModules = [ ]; @@ -40,7 +42,7 @@ device = "/dev/disk/by-label/nixos"; fsType = "ext4"; }; - + fileSystems."/home" = { device = "/dev/disk/by-label/home"; @@ -52,30 +54,25 @@ nix = { gc = { - automatic = true; + automatic = lib.mkForce false; # Temporarily disabled, TODO: re-enable options = "--delete-older-than 3d"; }; # package = pkgs.nixFromMaster; - package = pkgs.nix; # currently from unstable through an overlay - extraOptions = '' - experimental-features = ca-derivations + package = pkgs.nix; + extraOptions = lib.mkForce '' + experimental-features = ca-derivations nix-command flakes + + keep-outputs = true + keep-derivations = true ''; }; + systemd.services.nix-daemon.serviceConfig = { + LimitNOFILE = lib.mkForce 131072; # should help with fds errors due to experimental feature `ca-derivations` + }; + networking.firewall = { enable = true; allowPing = true; }; - - # TODO: disable, only for playing - services.hydra = { - enable = true; - hydraURL = "http://localhost:3000"; - notificationSender = "hydra@localhost"; - buildMachinesFiles = [ ]; - useSubstitutes = true; - }; - - - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/overlays/overrides.nix b/overlays/overrides.nix deleted file mode 100644 index b1f201c..0000000 --- a/overlays/overrides.nix +++ /dev/null @@ -1,28 +0,0 @@ -channels: final: prev: { - - __dontExport = true; # overrides clutter up actual creations - - # inherit (channels.latest) - # cachix - # dhall - # discord - # element-desktop - # rage - # nixpkgs-fmt - # qutebrowser - # signal-desktop - # starship; - - - # haskellPackages = prev.haskellPackages.override - # (old: { - # overrides = prev.lib.composeExtensions (old.overrides or (_: _: { })) (hfinal: hprev: - # let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version; - # in - # { - # # same for haskell packages, matching ghc versions - # inherit (channels.unstable.haskell.packages."ghc${version}") - # haskell-language-server; - # }); - # }); -} diff --git a/pkgs/default.nix b/pkgs/default.nix index 5f590e1..7a693d5 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,36 +1,28 @@ -{ nixpkgsUnstableInput, nixpkgsDevInput }: - +{ nixpkgsStableInput, nixpkgsDevInput }: final: prev: let - nixpkgsUnstable = (import nixpkgsUnstableInput { + config.allowUnfree = true; + overlays = [ ]; + nixpkgsStable = (import nixpkgsStableInput { + inherit config overlays; system = prev.system; - config.allowUnfree = true; }).pkgs; nixpkgsDev = (import nixpkgsDevInput { + inherit config overlays; system = prev.system; - config.allowUnfree = true; }).pkgs; in { # keep sources this first # sources = prev.callPackage (import ./_sources/generated.nix) { }; - customEmacs = prev.callPackage (import ./emacs) { }; amule = prev.callPackage (import ./amule) { }; - digikam = nixpkgsUnstable.digikam; - #cura = nixpkgsUnstable.cura; - qutebrowser = import ./qutebrowser { pkgs = prev; }; - #firefox-unwrapped = nixpkgsUnstable.firefox-unwrapped; - xdg-desktop-portal = nixpkgsUnstable.xdg-desktop-portal; - xdg-desktop-portal-gtk = nixpkgsUnstable.xdg-desktop-portal-gtk; - vscode = nixpkgsUnstable.vscode; - geoclue2 = nixpkgsUnstable.geoclue2; - gnome = nixpkgsUnstable.gnome; - umoria = nixpkgsDev.umoria; + customEmacs = prev.callPackage (import ./emacs) { pkgs = prev; }; droidcam = prev.callPackage (import ./droidcam) { }; - v4l2loopback-dc = prev.callPackage (import ./v4l2loopback-dc) { kernel = prev.linux; }; - slack = import ./slack { pkgs = prev; }; google-chrome = import ./google-chrome { pkgs = prev; }; - nixFromMaster = import ./nix-from-master { nix = nixpkgsUnstable.nix; pkgs = prev; }; - nix = nixpkgsUnstable.nix; + nixFromMaster = import ./nix-from-master { nix = prev.nix; pkgs = prev; }; + qutebrowser = import ./qutebrowser { pkgs = prev; }; + slack = import ./slack { pkgs = prev; }; + umoria = nixpkgsDev.umoria; + v4l2loopback-dc = prev.callPackage (import ./v4l2loopback-dc) { kernel = prev.linux; }; # then, call packages with `final.callPackage` } diff --git a/pkgs/emacs/default.nix b/pkgs/emacs/default.nix index df0263c..54b3cd0 100644 --- a/pkgs/emacs/default.nix +++ b/pkgs/emacs/default.nix @@ -1,6 +1,6 @@ { pkgs, ... }: let - myEmacs = pkgs.emacsPgtkGcc; + myEmacs = pkgs.emacsPgtkNativeComp; emacsWithPackages = (pkgs.emacsPackagesFor myEmacs).emacsWithPackages; in emacsWithPackages ( @@ -9,6 +9,8 @@ emacsWithPackages ( ) ++ ( with epkgs.melpaPackages; [ # dirvish + vimish-fold + evil-vimish-fold aggressive-indent all-the-icons company diff --git a/users/andreaciceri/default.nix b/users/andreaciceri/default.nix deleted file mode 100644 index f24e8b4..0000000 --- a/users/andreaciceri/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, lib, pkgs, emacs-overlay, ... }: { - home-manager.users."andreaciceri" = { ... }: { - imports = [ - ../profiles/bat - ../profiles/fzf - ../profiles/zsh - ../profiles/git - ../profiles/direnv - ../profiles/exa - ../profiles/emacs - ]; - home.packages = with pkgs; [ - yarn - pinentry_mac - openscad - nodejs-14_x - - poetry - ipfs - ipget - - yabai - skhd - spacebar - xquartz - xterm - - qmk - - youtube-dl - ffmpeg - ]; - - programs.gpg = { - homedir = "/Users/andreaciceri/.gnupg"; - enable = true; - }; - }; -} diff --git a/users/profiles/direnv/default.nix b/users/profiles/direnv/default.nix index f8b444e..fd719c9 100644 --- a/users/profiles/direnv/default.nix +++ b/users/profiles/direnv/default.nix @@ -6,7 +6,6 @@ }; nix-direnv = { enable = true; - enableFlakes = true; }; }; } diff --git a/users/profiles/emacs/default.nix b/users/profiles/emacs/default.nix index d029916..742ba3a 100644 --- a/users/profiles/emacs/default.nix +++ b/users/profiles/emacs/default.nix @@ -12,7 +12,7 @@ }; services.emacs = { - enable = !pkgs.stdenv.hostPlatform.isDarwin; + enable = true; }; # For some reason Hunspell dictionaries paths must be specified on Darwin @@ -38,7 +38,6 @@ delta fd graphviz-nox - haskell-language-server hunspell hunspellDicts.en_US hunspellDicts.it_IT @@ -49,7 +48,6 @@ python3Full rnix-lsp silver-searcher - stylish-haskell unzip ( makeDesktopItem { @@ -58,19 +56,12 @@ comment = "Org protocol"; desktopName = "org-protocol"; type = "Application"; - mimeType = "x-scheme-handler/org-protocol"; + mimeTypes = [ "x-scheme-handler/org-protocol" ]; } ) ] ++ (if pkgs.system == "x86_64-linux" then [ python-language-server ] ++ (with easy-ps; [ - # spago2nix ffmpegthumbnailer - nodejs - pulp - purescript-language-server - purs - purs-tidy - spago ]) else [ ]); } diff --git a/users/profiles/emacs/emacs.d/config/config-direnv.lsp b/users/profiles/emacs/emacs.d/config/config-direnv.el similarity index 80% rename from users/profiles/emacs/emacs.d/config/config-direnv.lsp rename to users/profiles/emacs/emacs.d/config/config-direnv.el index 1505317..358aa82 100644 --- a/users/profiles/emacs/emacs.d/config/config-direnv.lsp +++ b/users/profiles/emacs/emacs.d/config/config-direnv.el @@ -4,4 +4,4 @@ :config (envrc-global-mode)) -(provide 'config-envrc) +(provide 'config-direnv) diff --git a/users/profiles/emacs/emacs.d/config/config-evil.el b/users/profiles/emacs/emacs.d/config/config-evil.el index 8797f2f..e464116 100644 --- a/users/profiles/emacs/emacs.d/config/config-evil.el +++ b/users/profiles/emacs/emacs.d/config/config-evil.el @@ -16,4 +16,17 @@ :config (evil-collection-init)) +(use-package vimish-fold + :ensure + :after evil) + +(use-package evil-vimish-fold + :ensure + :after vimish-fold + :init + (setq evil-vimish-fold-mode-lighter " ⮒") + (setq evil-vimish-fold-target-modes '(prog-mode conf-mode text-mode)) + :config + (global-evil-vimish-fold-mode)) + (provide 'config-evil) diff --git a/users/profiles/emacs/emacs.d/config/config-nix.el b/users/profiles/emacs/emacs.d/config/config-nix.el index 0a82735..4151db9 100644 --- a/users/profiles/emacs/emacs.d/config/config-nix.el +++ b/users/profiles/emacs/emacs.d/config/config-nix.el @@ -1,9 +1,9 @@ (use-package nix-mode :mode "\\.nix\\'" - ;;:hook - ;;(before-save . lsp-format-buffer) - ) - + :config (setq format-on-save t) + :bind ("" . (lambda () (interactive) (setq format-on-save (not format-on-save)) )) + :hook + (before-save . (lambda () (when (format-on-save) (lsp-format-buffer))))) (require 'sudo-utils) diff --git a/users/profiles/qutebrowser/default.nix b/users/profiles/qutebrowser/default.nix index 1ab684c..435d55b 100644 --- a/users/profiles/qutebrowser/default.nix +++ b/users/profiles/qutebrowser/default.nix @@ -41,7 +41,7 @@ comment = "Qutebrowser"; desktopName = "qutebrowser"; type = "Application"; - mimeType = "x-scheme-handler/https"; + mimeTypes = [ "x-scheme-handler/https" ]; } ) ]; diff --git a/users/profiles/vscode/default.nix b/users/profiles/vscode/default.nix index 1748864..4932c5c 100644 --- a/users/profiles/vscode/default.nix +++ b/users/profiles/vscode/default.nix @@ -1,9 +1,5 @@ { pkgs, ... }: { - # only purpose of this is to make vscode login to Github - services.gnome-keyring.enable = true; - - programs.vscode = { enable = true;