From a53c4e737540ca5add700c0d9e25e1a1ffd960ce Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Wed, 20 Nov 2024 00:39:15 +0900 Subject: [PATCH] Update to NixOS 24.11 - Vicuna :camel: (#943) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update NixOS and related channels to 24.11 as possible now * Bump dprint-plugin-kdl with the new schema of dprint * `git ls-files | xargs selfup run` * Bump NixOS stateVersion as same as home-manager * Update temporally copied cloudflare-warp NixOS module * Remove depreceted sound option in NixOS https://github.com/NixOS/nixpkgs/blob/8e5e5a6add04c7f1e38e76f59ada6732947f1e55/nixos/doc/manual/release-notes/rl-2411.section.md?plain=1#L883-L885 * Remove failing and ussing SKK dependencies * Remove unused edge pkgs from configuration.nix * Enable systemd.enableStrictShellChecks * Replace edge-pkgs with pkgs as possible * Use stable nixpkgs in xremap flake * Bump NixOS-WSL channel * Bump darwin channel to include kdl.vim * Fix missing a bump for gpg-sq * Replace edge-pkgs as possible in ssh context * Adopt TODO comment around updating to NixOS 24.11 * Adopt xdg.stateFile since 24.11 * Add ignoring tag for 24.11 in goreleaser * Simply bump nix related github URLs in comments # No tested * Suppress nixf warning * Install ox and jnv also in maOS * Remove needless package replacement * Fix a typo [ci skip] * Update namespace of gnome packages whcih moved to toplevel * Dsiable enableStrictShellChecks for now * Follow https://github.com/NixOS/nixpkgs/commit/bcc7eff2c580649de8f8c92faf0fc64141f7f026 * Pin to correct stable NixOS 24.11 channel Closes GH-944. The bot works is not enough * flake.lock: Update Flake lock file updates: • Updated input 'edge-nixpkgs': 'github:NixOS/nixpkgs/dc460ec76cbff0e66e269457d7b728432263166c' (2024-11-11) → 'github:NixOS/nixpkgs/5e4fbfb6b3de1aa2872b76d49fafc942626e2add' (2024-11-15) • Updated input 'nixos-wsl/flake-utils': 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11) → 'github:numtide/flake-utils/c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a' (2024-09-17) * Using in macOS is much pain Follow GH-911 and GH-913 with nix-init 0.3.2 failing in intel macOS * Remove needless unstable in devshell * Fix quotation in above commit * Use release channel in Linux again to avoid fcitx5-mozc and bazel_7 problem * Refactor edge and homemade with overlays * Follow home-manaher kitty module changes * Install lima with nixpkgs in macOS since it has been udpated * flake.lock: Update Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/4637bf5b68943c5d694fdbd20652d496997f088d' (2024-11-18) → 'github:NixOS/nixpkgs/3b9b50532fb7712d3714cf25f4e61e8f71a04292' (2024-11-19) • Updated input 'nixpkgs-darwin': 'github:NixOS/nixpkgs/f4a0fbc120cd775346111246b453f8af94afc1d1' (2024-11-14) → 'github:NixOS/nixpkgs/8d48200ead5adea71485965f92405575c66dab04' (2024-11-19) * Include fcitx5-mozc quick fix patch * Backto NixOS 24.11 beta again * Use latest for broken calibre and zed-editor * Revert "Use latest for broken calibre and zed-editor" This reverts commit 2520946b08bd5ce9ea69e2cec2d8f19321f4388c. * Revert "Backto NixOS 24.11 beta again" This reverts commit 00f14fc7dbcd1a6e6799ceca2d12c14343de7440. * Clarify why I need release-24.11 instead of nixos-24.11 * Add comments about why I need nixpkgs-unstable for now --- .github/renovate.json | 6 - .github/workflows/ci-nix.yml | 3 + .github/workflows/lint.yml | 4 +- .github/workflows/windows.yml | 2 +- .goreleaser.yaml | 1 + Makefile.toml | 7 + README.md | 12 +- config/firefox/README.md | 2 +- dprint.json | 2 +- flake.lock | 56 ++--- flake.nix | 332 ++++++++++++++---------------- home-manager/bash.nix | 12 +- home-manager/common.nix | 16 +- home-manager/darwin.nix | 8 +- home-manager/editors.nix | 2 +- home-manager/encryption.nix | 11 +- home-manager/firefox.nix | 2 +- home-manager/fzf.nix | 2 +- home-manager/git.nix | 18 +- home-manager/gnome.nix | 2 +- home-manager/helix.nix | 4 +- home-manager/linux.nix | 12 +- home-manager/micro.nix | 13 +- home-manager/packages.nix | 15 +- home-manager/ssh.nix | 12 +- home-manager/systemd.nix | 2 +- home-manager/terminals.nix | 4 +- home-manager/vim.nix | 17 +- home-manager/wsl.nix | 2 +- home-manager/zsh.nix | 8 +- nixos/configuration.nix | 29 +-- nixos/console.nix | 8 +- nixos/desktop/default.nix | 85 ++++---- nixos/desktop/font.nix | 6 +- nixos/hosts/moss/fingerprint.nix | 2 +- nixos/hosts/wsl/default.nix | 3 +- nixos/modules/cloudflare-warp.nix | 100 --------- overlays/default.nix | 14 ++ pkgs/check_nixf/default.nix | 16 +- pkgs/default.nix | 4 +- 40 files changed, 359 insertions(+), 497 deletions(-) delete mode 100644 nixos/modules/cloudflare-warp.nix create mode 100644 overlays/default.nix diff --git a/.github/renovate.json b/.github/renovate.json index 6a0e5893..b015cdd9 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -26,12 +26,6 @@ "matchPackageNames": [ "dprint{/,}**" ] - }, - { - "matchPackageNames": [ - "kachick/dprint-plugin-kdl" - ], - "allowedVersions": "<0.2.0" } ] } diff --git a/.github/workflows/ci-nix.yml b/.github/workflows/ci-nix.yml index 3b0b4dab..1acac12f 100644 --- a/.github/workflows/ci-nix.yml +++ b/.github/workflows/ci-nix.yml @@ -43,3 +43,6 @@ jobs: # https://github.com/kachick/dotfiles/pull/718#issuecomment-2266331003 if: runner.os == 'Linux' - run: nix develop --command makers ci-dev + if: runner.os == 'Linux' + - run: nix develop --command makers ci-darwin + if: runner.os == 'macOS' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 607250b8..c9fea030 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,14 +13,14 @@ jobs: - uses: actions/checkout@v4 - uses: dprint/check@v2.2 with: - dprint-version: '0.45.1' # selfup {"extract":"\\d[^']+","replacer":["dprint", "--version"], "nth": 2} + dprint-version: '0.47.2' # selfup {"extract":"\\d[^']+","replacer":["dprint", "--version"], "nth": 2} typos: timeout-minutes: 15 runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - uses: crate-ci/typos@v1.21.0 # selfup {"extract":"\\d\\.\\d+\\.\\d+","replacer":["typos", "--version"], "nth": 2} + - uses: crate-ci/typos@v1.27.3 # selfup {"extract":"\\d\\.\\d+\\.\\d+","replacer":["typos", "--version"], "nth": 2} with: # https://github.com/crate-ci/typos/issues/779#issuecomment-1635761199 files: | diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index fc15cc26..7ec948f6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -113,7 +113,7 @@ jobs: uses: goreleaser/goreleaser-action@v6 with: install-only: true - version: 'v1.26.1' # selfup { "extract": "\\d[^']+", "replacer": ["bash", "-c", "goreleaser --version | grep 'GitVersion:'"], "nth": 2 } + version: 'v2.4.4' # selfup { "extract": "\\d[^']+", "replacer": ["bash", "-c", "goreleaser --version | grep 'GitVersion:'"], "nth": 2 } - name: List files - before build run: Get-ChildItem - name: Build winit-* diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 53bb15a8..8a9bf63a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -65,5 +65,6 @@ git: # Templates: allowed ignore_tags: - nixos-24.05-release + - nixos-24.11-release # I can't use ignore_tag_prefixes, it is GoReleaser Pro only feature :< diff --git a/Makefile.toml b/Makefile.toml index edb53a77..e9365e51 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -143,6 +143,13 @@ dependencies = [ 'fmt', ] +# Basically giveup to develop on macOS. However I need to use task-runner for minimum use. +[tasks.ci-darwin] +command = 'makers' +args = [ + '--version', +] + [tasks.build-container] command = './containers/build.bash' diff --git a/README.md b/README.md index 5a335fa6..04bdde32 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ block-beta end block:vm:3 - lima("Lima") wsl2("WSL2") + lima("Lima") wsl2("WSL2") end block:container:3 @@ -173,13 +173,15 @@ Check [traps](./windows/Multi-booting.md) ## macOS -Apply home-manager with `kachick@macbook` for minimum packages. +I basically [give up to maintain macOS environment](https://github.com/kachick/dotfiles/issues/911). -I basically [give up to maintain macOS environment](https://github.com/kachick/dotfiles/issues/911). Use [Lima](#lima) for development tasks. +1. Apply home-manager with `kachick@macbook` for minimum packages. +1. Install [some packages](https://github.com/kachick/dotfiles/wiki/macOS) without Nix +1. Use [Lima](#lima) for development tasks. -## [Lima](https://github.com/lima-vm/lima) +## Lima -1. Manually setup [lima](https://github.com/kachick/dotfiles/issues/146#issuecomment-2453430154)(default Ubuntu guest) and [some packages](https://github.com/kachick/dotfiles/wiki/macOS) without Nix +1. Setup [Lima](https://github.com/lima-vm/lima) with default Ubuntu guest 1. In the lima as `limactl start`, apply home-manager with `kachick@lima` 1. You can run containers as `lima nerdctl run --rm hello-world`. You can also use podman after above `Podman on Ubuntu` setups diff --git a/config/firefox/README.md b/config/firefox/README.md index d0ec3d0e..d4e00392 100644 --- a/config/firefox/README.md +++ b/config/firefox/README.md @@ -11,7 +11,7 @@ And helps to know the overview. ## How to change finder in page position from bottom to top? -In Nix, we can define this step with +In Nix, we can define this step with 1. `about:config` 1. Enable `toolkit.legacyUserProfileCustomizations.stylesheets` diff --git a/dprint.json b/dprint.json index a03f2852..d3fd1d54 100644 --- a/dprint.json +++ b/dprint.json @@ -23,6 +23,6 @@ "https://plugins.dprint.dev/markdown-0.17.8.wasm", "https://plugins.dprint.dev/toml-0.6.3.wasm", "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm", - "https://plugins.dprint.dev/kachick/kdl-0.1.0.wasm" + "https://plugins.dprint.dev/kachick/kdl-0.2.1.wasm" ] } diff --git a/flake.lock b/flake.lock index a634c184..afd7fdc4 100644 --- a/flake.lock +++ b/flake.lock @@ -72,16 +72,16 @@ }, "edge-nixpkgs": { "locked": { - "lastModified": 1731676054, - "narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=", + "lastModified": 1731890469, + "narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add", + "rev": "5083ec887760adfe12af64830a66807423a859a7", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -125,11 +125,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -163,16 +163,16 @@ ] }, "locked": { - "lastModified": 1726989464, - "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", + "lastModified": 1731880681, + "narHash": "sha256-FmYTkIyPBUxSWgA7DPIVTsCCMvSSbs56yOtHpLNSnKg=", "owner": "nix-community", "repo": "home-manager", - "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", + "rev": "aecd341dfead1c3ef7a3c15468ecd71e8343b7c6", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.05", + "ref": "release-24.11", "repo": "home-manager", "type": "github" } @@ -184,16 +184,16 @@ ] }, "locked": { - "lastModified": 1726989464, - "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", + "lastModified": 1731880681, + "narHash": "sha256-FmYTkIyPBUxSWgA7DPIVTsCCMvSSbs56yOtHpLNSnKg=", "owner": "nix-community", "repo": "home-manager", - "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", + "rev": "aecd341dfead1c3ef7a3c15468ecd71e8343b7c6", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.05", + "ref": "release-24.11", "repo": "home-manager", "type": "github" } @@ -379,48 +379,48 @@ ] }, "locked": { - "lastModified": 1720391164, - "narHash": "sha256-RrJsSelbJ/SCrnCH0yLEvgVSKVoG7b45Qhf/6fOiQ8I=", + "lastModified": 1731682434, + "narHash": "sha256-HnZFPB7akVIy0KuPq/tEkiB+Brt1qi0DUIDzR8z25qI=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "05098ab6e48684c573d7033bd583b1eea2f5f851", + "rev": "a6b9cf0b7805e2c50829020a73e7bde683fd36dd", "type": "github" }, "original": { "owner": "nix-community", - "ref": "2405.5.4", + "ref": "main", "repo": "NixOS-WSL", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1731797254, - "narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=", + "lastModified": 1732022771, + "narHash": "sha256-EZlel51EEsv4vki3zGFHT9fG35Vl5/FMKT6PCwOsz90=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", + "rev": "3b9b50532fb7712d3714cf25f4e61e8f71a04292", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.05", + "ref": "release-24.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-darwin": { "locked": { - "lastModified": 1730891215, - "narHash": "sha256-i85DPrhDuvzgvIWCpJlbfM2UFtNYbapo20MtQXsvay4=", + "lastModified": 1731989499, + "narHash": "sha256-mYVmnkkyVcY9e2FmbrT+ZTCjrijOeVT+QtIv6omhkmM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c128e44a249d6180740d0a979b6480d5b795c013", + "rev": "8d48200ead5adea71485965f92405575c66dab04", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-24.05-darwin", + "ref": "nixpkgs-24.11-darwin", "repo": "nixpkgs", "type": "github" } @@ -640,7 +640,7 @@ "home-manager": "home-manager", "hyprland": "hyprland", "nixpkgs": [ - "edge-nixpkgs" + "nixpkgs" ], "treefmt-nix": "treefmt-nix", "xremap": "xremap" diff --git a/flake.nix b/flake.nix index 2c898180..42854dc8 100644 --- a/flake.nix +++ b/flake.nix @@ -1,32 +1,39 @@ { + description = "kachick's dotfiles that can be placed in the public repository"; + inputs = { # Candidate channels # - https://github.com/kachick/anylang-template/issues/17 # - https://discourse.nixos.org/t/differences-between-nix-channels/13998 # How to update the revision # - `nix flake update --commit-lock-file` # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-update.html - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; - edge-nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # Unfit for darwin, might be broken. See https://github.com/NixOS/nixpkgs/issues/107466 - nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin"; - # https://github.com/nix-community/home-manager/blob/release-24.05/docs/manual/nix-flakes.md + # TODO: Pin to nixos-24.11 after applied following crucial patches + # - fcitx5-mozc: https://github.com/NixOS/nixpkgs/pull/356590 + # - zed-editor: https://github.com/NixOS/nixpkgs/pull/356459 + # - calibre: https://github.com/NixOS/nixpkgs/pull/355885 + nixpkgs.url = "github:NixOS/nixpkgs/release-24.11"; + # darwin does not have desirable channel for that purpose. See https://github.com/NixOS/nixpkgs/issues/107466 + edge-nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; # TODO: Prefer nixos-unstable after https://github.com/NixOS/nixpkgs/pull/356590 included + nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-24.11-darwin"; + # https://github.com/nix-community/home-manager/blob/release-24.11/docs/manual/nix-flakes.md home-manager-linux = { - url = "github:nix-community/home-manager/release-24.05"; + url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; home-manager-darwin = { - url = "github:nix-community/home-manager/release-24.05"; + url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs-darwin"; }; nixos-wsl = { - url = "github:nix-community/NixOS-WSL/2405.5.4"; + url = "github:nix-community/NixOS-WSL/main"; # TODO: Pin to 2411.?.? if 24.11 conpat channel will be introduced # https://github.com/nix-community/NixOS-WSL/blob/5a965cb108fb1f30b29a26dbc29b473f49e80b41/flake.nix#L5 inputs.nixpkgs.follows = "nixpkgs"; }; # https://github.com/xremap/nix-flake/blob/master/docs/HOWTO.md + # TODO: Prefer nixpkgs version after https://github.com/NixOS/nixpkgs/pull/283278 merged xremap-flake = { url = "github:xremap/nix-flake"; - # https://github.com/xremap/nix-flake/blob/2c55335d6509702b0d337b8da697d7048e36123d/flake.nix#L6 - inputs.nixpkgs.follows = "edge-nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; }; selfup = { url = "github:kachick/selfup/v1.1.6"; @@ -48,7 +55,7 @@ let inherit (self) outputs; - # Candidates: https://github.com/NixOS/nixpkgs/blob/release-24.05/lib/systems/flake-systems.nix + # Candidates: https://github.com/NixOS/nixpkgs/blob/release-24.11/lib/systems/flake-systems.nix forAllSystems = nixpkgs.lib.genAttrs ( nixpkgs.lib.intersectLists [ "x86_64-linux" @@ -59,6 +66,14 @@ mkNixpkgs = system: if (nixpkgs.lib.strings.hasSuffix "-darwin" system) then nixpkgs-darwin else nixpkgs; + overlays = import ./overlays { inherit edge-nixpkgs; }; + + mkPkgs = + system: + import (mkNixpkgs system) { + inherit system overlays; + }; + mkHomeManager = system: if (nixpkgs.lib.strings.hasSuffix "-darwin" system) then @@ -72,13 +87,6 @@ type = "app"; program = (mkNixpkgs system).lib.getExe pkg; }; - - homemade-packages = forAllSystems ( - system: - ((mkNixpkgs system).legacyPackages.${system}.callPackage ./pkgs { - edge-pkgs = edge-nixpkgs.legacyPackages.${system}; - }) - ); in { # nixfmt will be official @@ -86,14 +94,12 @@ # - https://github.com/NixOS/nixfmt/issues/129 # - https://github.com/NixOS/rfcs/pull/166 # - https://github.com/NixOS/nixfmt/blob/a81f922a2b362f347a6cbecff5fb14f3052bc25d/README.md#L19 - formatter = forAllSystems (system: (mkNixpkgs system).legacyPackages.${system}.nixfmt-rfc-style); + formatter = forAllSystems (system: (mkPkgs system).nixfmt-rfc-style); devShells = forAllSystems ( system: let - pkgs = (mkNixpkgs system).legacyPackages.${system}; - edge-pkgs = edge-nixpkgs.legacyPackages.${system}; - homemade-pkgs = homemade-packages.${system}; + pkgs = mkPkgs system; in { default = pkgs.mkShellNoCC { @@ -106,48 +112,57 @@ (with pkgs; [ # https://github.com/NixOS/nix/issues/730#issuecomment-162323824 bashInteractive - nixfmt-rfc-style - nixpkgs-lint-community - nix-init - nurl - hydra-check # Background and how to use: https://github.com/kachick/dotfiles/pull/909#issuecomment-2453389909 - - shellcheck - shfmt gitleaks cargo-make + ]) + ++ (pkgs.lib.optionals pkgs.stdenv.isLinux ( + (with pkgs; [ + nixfmt-rfc-style + nixd + nixf # `nixf-tidy` + nixpkgs-lint-community + nix-init + nurl + hydra-check # Background and how to use: https://github.com/kachick/dotfiles/pull/909#issuecomment-2453389909 - dprint - stylua - typos - typos-lsp # For zed-editor typos extension - go_1_23 - goreleaser - trivy + shellcheck + shfmt - (ruby_3_3.withPackages (ps: with ps; [ rubocop ])) - ]) - ++ (with edge-pkgs; [ - nixd - # Don't use treefmt(treefmt1) that does not have crucial feature to cover hidden files - # https://github.com/numtide/treefmt/pull/250 - treefmt2 - markdownlint-cli2 - ]) - ++ (with homemade-pkgs; [ nix-hash-url ]) - ++ [ inputs.selfup.packages.${system}.default ]; + # Don't use treefmt(treefmt1) that does not have crucial feature to cover hidden files + # https://github.com/numtide/treefmt/pull/250 + treefmt2 + dprint + stylua + typos + typos-lsp # For zed-editor typos extension + go_1_23 + goreleaser + trivy + markdownlint-cli2 + + (ruby_3_3.withPackages (ps: with ps; [ rubocop ])) + ]) + ++ (with pkgs.my; [ nix-hash-url ]) + ++ [ inputs.selfup.packages.${system}.default ] + )); }; } ); - packages = forAllSystems (system: { - cozette = homemade-packages.${system}.cozette; - micro-kdl = homemade-packages.${system}.micro-kdl; - micro-nordcolors = homemade-packages.${system}.micro-nordcolors; - micro-everforest = homemade-packages.${system}.micro-everforest; - micro-catppuccin = homemade-packages.${system}.micro-catppuccin; - envs = homemade-packages.${system}.envs; - }); + packages = forAllSystems ( + system: + let + pkgs = mkPkgs system; + in + { + cozette = pkgs.my.cozette; + micro-kdl = pkgs.my.micro-kdl; + micro-nordcolors = pkgs.my.micro-nordcolors; + micro-everforest = pkgs.my.micro-everforest; + micro-catppuccin = pkgs.my.micro-catppuccin; + envs = pkgs.my.envs; + } + ); apps = forAllSystems ( system: @@ -157,7 +172,7 @@ inherit name; value = mkApp { system = system; - pkg = homemade-packages.${system}.${name}; + pkg = (mkPkgs system).my.${name}; }; }) [ @@ -202,21 +217,13 @@ nixosConfigurations = let system = "x86_64-linux"; - edge-pkgs = import edge-nixpkgs { - inherit system; - config = { - allowUnfree = true; - }; - }; - homemade-pkgs = homemade-packages.${system}; shared = { inherit system; specialArgs = { inherit inputs outputs - homemade-pkgs - edge-pkgs + overlays ; }; }; @@ -229,127 +236,98 @@ homeConfigurations = let - x86-Linux = { - pkgs = nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { - homemade-pkgs = homemade-packages.x86_64-linux; - edge-pkgs = edge-nixpkgs.legacyPackages.x86_64-linux; - }; - }; - - x86-macOS = { - pkgs = nixpkgs-darwin.legacyPackages.x86_64-darwin; - extraSpecialArgs = { - homemade-pkgs = homemade-packages.x86_64-darwin; - edge-pkgs = edge-nixpkgs.legacyPackages.x86_64-darwin; - }; - }; + x86-Linux-pkgs = mkPkgs "x86_64-linux"; + x86-macOS-pkgs = mkPkgs "x86_64-darwin"; in { - "kachick@nixos-desktop" = home-manager-linux.lib.homeManagerConfiguration ( - x86-Linux - // { - modules = [ - ./home-manager/kachick.nix - ./home-manager/linux.nix - { targets.genericLinux.enable = false; } - ./home-manager/lima-host.nix - ./home-manager/systemd.nix - ./home-manager/gnome.nix - ./home-manager/firefox.nix - ]; - } - ); + "kachick@nixos-desktop" = home-manager-linux.lib.homeManagerConfiguration { + pkgs = x86-Linux-pkgs; + modules = [ + ./home-manager/kachick.nix + ./home-manager/linux.nix + { targets.genericLinux.enable = false; } + ./home-manager/lima-host.nix + ./home-manager/systemd.nix + ./home-manager/gnome.nix + ./home-manager/firefox.nix + ]; + }; - "kachick@wsl-ubuntu" = home-manager-linux.lib.homeManagerConfiguration ( - x86-Linux - // { - modules = [ - ./home-manager/kachick.nix - ./home-manager/linux.nix - ./home-manager/genericLinux.nix - ./home-manager/wsl.nix - ]; - } - ); + "kachick@wsl-ubuntu" = home-manager-linux.lib.homeManagerConfiguration { + pkgs = x86-Linux-pkgs; + modules = [ + ./home-manager/kachick.nix + ./home-manager/linux.nix + ./home-manager/genericLinux.nix + ./home-manager/wsl.nix + ]; + }; - "nixos@wsl-nixos" = home-manager-linux.lib.homeManagerConfiguration ( - x86-Linux - // { - modules = [ - ./home-manager/kachick.nix - ./home-manager/linux.nix - { - home.username = "nixos"; - targets.genericLinux.enable = false; - } - ./home-manager/wsl.nix - ]; - } - ); + "nixos@wsl-nixos" = home-manager-linux.lib.homeManagerConfiguration { + pkgs = x86-Linux-pkgs; + modules = [ + ./home-manager/kachick.nix + ./home-manager/linux.nix + { + home.username = "nixos"; + targets.genericLinux.enable = false; + } + ./home-manager/wsl.nix + ]; + }; - "kachick@macbook" = home-manager-darwin.lib.homeManagerConfiguration ( - x86-macOS - // { - modules = [ - ./home-manager/kachick.nix - ./home-manager/darwin.nix - ]; - } - ); + "kachick@macbook" = home-manager-darwin.lib.homeManagerConfiguration { + pkgs = x86-macOS-pkgs; + modules = [ + ./home-manager/kachick.nix + ./home-manager/darwin.nix + ]; + }; - "kachick@lima" = home-manager-darwin.lib.homeManagerConfiguration ( - x86-Linux - // { - modules = [ - ./home-manager/kachick.nix - ./home-manager/linux.nix - ./home-manager/genericLinux.nix - ./home-manager/lima-guest.nix - ]; - } - ); + "kachick@lima" = home-manager-darwin.lib.homeManagerConfiguration { + pkgs = x86-Linux-pkgs; + modules = [ + ./home-manager/kachick.nix + ./home-manager/linux.nix + ./home-manager/genericLinux.nix + ./home-manager/lima-guest.nix + ]; + }; - "github-actions@ubuntu-24.04" = home-manager-linux.lib.homeManagerConfiguration ( - x86-Linux - // { - # Prefer "kachick" over "common" only here. - # Using values as much as possible as actual values to create a robust CI - modules = [ - ./home-manager/kachick.nix - ./home-manager/linux.nix - { home.username = "runner"; } - ./home-manager/genericLinux.nix - ./home-manager/systemd.nix - ]; - } - ); + "github-actions@ubuntu-24.04" = home-manager-linux.lib.homeManagerConfiguration { + pkgs = x86-Linux-pkgs; + # Prefer "kachick" over "common" only here. + # Using values as much as possible as actual values to create a robust CI + modules = [ + ./home-manager/kachick.nix + ./home-manager/linux.nix + { home.username = "runner"; } + ./home-manager/genericLinux.nix + ./home-manager/systemd.nix + ]; + }; - "github-actions@macos-13" = home-manager-darwin.lib.homeManagerConfiguration ( - x86-macOS - // { - # Prefer "kachick" over "common" only here. - # Using values as much as possible as actual values to create a robust CI - modules = [ - ./home-manager/kachick.nix - ./home-manager/darwin.nix - { home.username = "runner"; } - ]; - } - ); + "github-actions@macos-13" = home-manager-darwin.lib.homeManagerConfiguration { + pkgs = x86-macOS-pkgs; + # Prefer "kachick" over "common" only here. + # Using values as much as possible as actual values to create a robust CI + modules = [ + ./home-manager/kachick.nix + ./home-manager/darwin.nix + { home.username = "runner"; } + ]; + }; - "user@linux-cli" = home-manager-linux.lib.homeManagerConfiguration ( - x86-Linux - // { - modules = [ - ./home-manager/common.nix - { home.username = "user"; } - ./home-manager/linux.nix - ./home-manager/genericLinux.nix - ./home-manager/systemd.nix - ]; - } - ); + "user@linux-cli" = home-manager-linux.lib.homeManagerConfiguration { + pkgs = x86-Linux-pkgs; + modules = [ + ./home-manager/common.nix + { home.username = "user"; } + ./home-manager/linux.nix + ./home-manager/genericLinux.nix + ./home-manager/systemd.nix + ]; + }; }; }; } diff --git a/home-manager/bash.nix b/home-manager/bash.nix index 11db07be..13047de1 100644 --- a/home-manager/bash.nix +++ b/home-manager/bash.nix @@ -2,8 +2,6 @@ config, lib, pkgs, - homemade-pkgs, - edge-pkgs, ... }: @@ -17,7 +15,7 @@ programs.zellij.enableBashIntegration = false; # Used only in bash - https://unix.stackexchange.com/a/689403 - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/readline.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/readline.nix programs.readline = { enable = true; variables = { @@ -39,7 +37,7 @@ }; }; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/bash.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/bash.nix programs.bash = { enable = true; @@ -107,7 +105,7 @@ ''; # For interactive shells. In .bashrc and after early return - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/bash.nix#L221-L222 + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/bash.nix#L221-L222 # And https://techracho.bpsinc.jp/hachi8833/2021_07_08/66396 may help to understand why .bashrc # # Extracting because embedded here requires complex escape with nix multiline. @@ -127,14 +125,14 @@ source "${pkgs.zellij}/share/bash-completion/completions/zellij.bash" # Adding only in devshell is not enough - source "${edge-pkgs.cargo-make}/share/bash-completion/completions/makers-completion.bash" + source "${pkgs.cargo-make}/share/bash-completion/completions/makers-completion.bash" source "${../dependencies/dprint/completions.bash}" # Disable `Ctrl + S(no output tty)` ${lib.getBin pkgs.coreutils}/bin/stty stop undef - source "${homemade-pkgs.posix_shared_functions}" + source "${pkgs.my.posix_shared_functions}" if [ 'linux' = "$TERM" ]; then # Avoid Tofu diff --git a/home-manager/common.nix b/home-manager/common.nix index 92011f38..44dc8eec 100644 --- a/home-manager/common.nix +++ b/home-manager/common.nix @@ -2,8 +2,6 @@ config, pkgs, lib, - edge-pkgs, - homemade-pkgs, ... }: @@ -21,7 +19,7 @@ # home.username = ""; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/misc/xdg.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/misc/xdg.nix xdg.enable = true; home = { @@ -33,7 +31,7 @@ # You can update Home Manager without changing this value. See # the Home Manager release notes for a list of state version # changes in each release. - stateVersion = "24.05"; + stateVersion = "24.11"; enableNixpkgsReleaseCheck = true; sessionVariables = { @@ -68,8 +66,6 @@ packages = import ./packages.nix { inherit pkgs; - inherit edge-pkgs; - inherit homemade-pkgs; }; # You can check the candidates in `locale -a` @@ -101,7 +97,7 @@ programs.lesspipe.enable = true; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/direnv.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/direnv.nix programs.direnv = { enable = true; @@ -135,12 +131,12 @@ home.file.".hushlogin".text = "This file disables daily login message. Not depend on this text."; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/starship.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/starship.nix programs.starship = { enable = true; }; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/bat.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/bat.nix programs.bat = { enable = true; @@ -154,7 +150,7 @@ }; }; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/zellij.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/zellij.nix programs.zellij = { enable = true; diff --git a/home-manager/darwin.nix b/home-manager/darwin.nix index 03ca0854..5fcdfc2b 100644 --- a/home-manager/darwin.nix +++ b/home-manager/darwin.nix @@ -1,6 +1,5 @@ { - pkgs, - # Don't depend on edge-pkgs as possible until realize https://github.com/NixOS/nixpkgs/issues/107466, + pkgs, # Don't depend on edge-pkgs as possible until realize https://github.com/NixOS/nixpkgs/issues/107466, config, ... }: @@ -30,10 +29,7 @@ ]; packages = with pkgs; [ - # for lima. However don't add lima in this dependencies. - # It should be installed without nix. - # See https://github.com/kachick/dotfiles/issues/146#issuecomment-2453430154 - qemu + lima # includes qemu # https://github.com/NixOS/nixpkgs/issues/240819 pinentry_mac diff --git a/home-manager/editors.nix b/home-manager/editors.nix index d45464fc..36649458 100644 --- a/home-manager/editors.nix +++ b/home-manager/editors.nix @@ -9,7 +9,7 @@ ./vim.nix ]; - # TODO: Update since release-24.11 https://github.com/nix-community/home-manager/pull/5455 + # TODO: Use https://github.com/nix-community/home-manager/pull/5455 to define the JSON xdg.configFile."zed/settings.json".source = ../config/zed/settings.json; home = { diff --git a/home-manager/encryption.nix b/home-manager/encryption.nix index 246bacd0..ebdd8507 100644 --- a/home-manager/encryption.nix +++ b/home-manager/encryption.nix @@ -1,7 +1,6 @@ { config, pkgs, - edge-pkgs, ... }: @@ -16,7 +15,7 @@ in # Don't set $SEQUOIA_HOME, it unified config and data, cache to one directory as same as gpg era. # Use default $HOME instead, it respects XDG Base Directory Specification - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/services/gpg-agent.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/services/gpg-agent.nix services.gpg-agent = { enable = pkgs.stdenv.isLinux; @@ -35,7 +34,7 @@ in }; home.sessionVariables = rec { - GOPASS_GPG_BINARY = "${pkgs.lib.getBin edge-pkgs.sequoia-chameleon-gnupg}/bin/gpg-sq"; + GOPASS_GPG_BINARY = "${pkgs.lib.getBin pkgs.sequoia-chameleon-gnupg}/bin/gpg-sq"; # Do NOT include the identity here PASSAGE_DIR = "${config.xdg.dataHome}/passage/store"; @@ -49,10 +48,10 @@ in home.file."${passage_identity_dir}/.keep".text = "Keep this directory because of passage and age does not create the file if directory is missing"; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/gpg.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/gpg.nix programs.gpg = { enable = true; - # package = edge-pkgs.sequoia-chameleon-gnupg; # Also will be respected in gpg-agent: https://github.com/nix-community/home-manager/blob/5171f5ef654425e09d9c2100f856d887da595437/modules/services/gpg-agent.nix#L8C3-L8C9 + # package = pkgs.sequoia-chameleon-gnupg; # Also will be respected in gpg-agent: https://github.com/nix-community/home-manager/blob/5171f5ef654425e09d9c2100f856d887da595437/modules/services/gpg-agent.nix#L8C3-L8C9 # However I prefer original gnupg for now, sequoia-chameleon-gnupg does not support crucial features for GPG toolset (etc. `gpg --edit-key`, `gpgconf`) # Preferring XDG_DATA_HOME rather than XDG_CONFIG_HOME from following examples @@ -72,7 +71,7 @@ in }; }; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/password-store.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/password-store.nix programs.password-store = { enable = true; package = pkgs.gopass; # Setting package is not a aliasing command, however I would try this for now. https://github.com/gopasspw/gopass/blob/70c56f9102999661b54e28c28fa2d63fa5fc813b/docs/setup.md?plain=1#L292-L298 diff --git a/home-manager/firefox.nix b/home-manager/firefox.nix index c7582cf6..c95c1903 100644 --- a/home-manager/firefox.nix +++ b/home-manager/firefox.nix @@ -1,6 +1,6 @@ { ... }: { - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/firefox.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/firefox.nix programs.firefox = { enable = true; # In firefox package, use null instead of `pkgs.emptyDirectory` diff --git a/home-manager/fzf.nix b/home-manager/fzf.nix index 415e77ae..47ba9669 100644 --- a/home-manager/fzf.nix +++ b/home-manager/fzf.nix @@ -1,7 +1,7 @@ { pkgs, ... }: { - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/fzf.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/fzf.nix # https://github.com/junegunn/fzf/blob/master/README.md programs.fzf = rec { enable = true; diff --git a/home-manager/git.nix b/home-manager/git.nix index ef7139ce..c3681e07 100644 --- a/home-manager/git.nix +++ b/home-manager/git.nix @@ -1,7 +1,5 @@ { pkgs, - homemade-pkgs, - edge-pkgs, lib, ... }: @@ -26,7 +24,7 @@ in { home.file."repos/.keep".text = "Put repositories here"; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/git.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/git.nix # xdg will be used in home-manager: https://github.com/nix-community/home-manager/blob/7b8d43fbaf8450c30caaed5eab876897d0af891b/modules/programs/git.nix#L417-L418 programs.git = { enable = true; @@ -42,7 +40,7 @@ in upstream = "!git remote | grep -E '^upstream$'|| git remote | grep -E '^origin$'"; refresh = "!git remote update origin --prune && git switch-default && git pull --prune \"$(git upstream)\" \"$(git current)\""; all = "!git refresh && git-delete-merged-branches"; - lf = "!${lib.getExe homemade-pkgs.git-log-fzf}"; + lf = "!${lib.getExe pkgs.my.git-log-fzf}"; reset-main = '' !git fetch origin && \ git switch main && \ @@ -50,16 +48,16 @@ in git checkout origin/main && \ git checkout -b main ''; - resolve-conflict = "!${lib.getExe homemade-pkgs.git-resolve-conflict}"; + resolve-conflict = "!${lib.getExe pkgs.my.git-resolve-conflict}"; }; # Required to provide all global hooks to respect local hooks even if it is empty. See GH-545 for detail # Candidates: https://github.com/git/git/tree/v2.44.1/templates hooks = { - commit-msg = lib.getExe homemade-pkgs.git-hooks-commit-msg; + commit-msg = lib.getExe pkgs.my.git-hooks-commit-msg; # Git does not provide hooks for renaming branch, so using in checkout phase is not enough - pre-push = lib.getExe homemade-pkgs.git-hooks-pre-push; + pre-push = lib.getExe pkgs.my.git-hooks-pre-push; pre-merge-commit = lib.getExe (mkPassthruHook "pre-merge-commit"); pre-applypatch = lib.getExe (mkPassthruHook "pre-applypatch"); @@ -89,7 +87,7 @@ in # See https://github.com/kachick/dotfiles/issues/289 for detail. format = "openpgp"; - program = "${pkgs.lib.getBin edge-pkgs.sequoia-chameleon-gnupg}/bin/gpg-sq"; # GH-830 + program = "${pkgs.lib.getBin pkgs.sequoia-chameleon-gnupg}/bin/gpg-sq"; # GH-830 }; commit = { @@ -160,7 +158,7 @@ in # If you encounter .config/gh/config.yml readonly permission errors, attempt after `rm -rf ~/.config/gh` # https://github.com/cli/cli/pull/5378#issuecomment-2252558180 # - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/gh.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/gh.nix programs.gh = { enable = true; @@ -201,6 +199,6 @@ in ]; }; - extensions = (with pkgs; [ gh-poi ]) ++ (with homemade-pkgs; [ gh-prs ]); + extensions = (with pkgs; [ gh-poi ]) ++ (with pkgs.my; [ gh-prs ]); }; } diff --git a/home-manager/gnome.nix b/home-manager/gnome.nix index 5e0a7eaa..cc8ca366 100644 --- a/home-manager/gnome.nix +++ b/home-manager/gnome.nix @@ -8,7 +8,7 @@ in xdg.dataFile."applications/${spotify-pwa-file}".source = ../config/pwa/spotify.desktop; xdg.dataFile."applications/${amazon_music-pwa-file}".source = ../config/pwa/amazon_music.desktop; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/misc/dconf.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/misc/dconf.nix dconf = { enable = true; settings = { diff --git a/home-manager/helix.nix b/home-manager/helix.nix index ea551f5d..8562685b 100644 --- a/home-manager/helix.nix +++ b/home-manager/helix.nix @@ -17,7 +17,7 @@ let }; in { - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/helix.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/helix.nix # keybinds: https://docs.helix-editor.com/keymap.html programs.helix = { # Enabling this may cause colisions. Do not add in packages list @@ -104,7 +104,7 @@ in }; language-servers = [ "nil" - # "nixd" # TODO: Enable since NixOS 24.11(Helix 24.07+) + "nixd" "typos" ]; } diff --git a/home-manager/linux.nix b/home-manager/linux.nix index 5d3efae4..451f6cbc 100644 --- a/home-manager/linux.nix +++ b/home-manager/linux.nix @@ -2,8 +2,6 @@ config, pkgs, lib, - edge-pkgs, - homemade-pkgs, ... }: @@ -21,7 +19,7 @@ iputils # `ping` etc # https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/iw/iw/package.nix - edge-pkgs.iw # replacement of wireless-tools(iwconfig) + iw # replacement of wireless-tools(iwconfig) # - Enable special module for Nix OS. # - Linux package does not contain podman-remote, you should install uidmap with apt and use this podman as actual engine @@ -35,22 +33,18 @@ stern k9s - edge-pkgs.ox # modeless editor. Use edge because of stable channel is too old - - edge-pkgs.jnv # interactive jq - Use unstable because it is a fresh tool - # Alt w3m # Do not install in dawin yet: https://github.com/NixOS/nixpkgs/blob/b4b293ec6c61e846d69224ea0637411283e2ad39/pkgs/by-name/ch/chawan/package.nix#L82 # Keybindigs: https://git.sr.ht/~bptato/chawan/tree/master/item/res/config.toml chawan # `cha` - homemade-pkgs.renmark # Depend on chawan + pkgs.my.renmark # Depend on chawan ]; }; # xdg-user-dirs NixOS module does not work or is not enough for me to keep English dirs even in Japanese locale. # Check your `~/.config/user-dirs.dirs` if you faced any trouble - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/misc/xdg-user-dirs.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/misc/xdg-user-dirs.nix xdg = { userDirs = { enable = true; diff --git a/home-manager/micro.nix b/home-manager/micro.nix index 3c19119b..90dc1f5a 100644 --- a/home-manager/micro.nix +++ b/home-manager/micro.nix @@ -1,7 +1,6 @@ { lib, pkgs, - homemade-pkgs, ... }: @@ -13,20 +12,20 @@ # For temporal use xdg.configFile."micro/colorschemes/.keep".text = ""; - xdg.configFile."micro/plug/fzfinder".source = homemade-pkgs.micro-fzfinder; - xdg.configFile."micro/plug/kdl".source = homemade-pkgs.micro-kdl; - xdg.configFile."micro/plug/nordcolors".source = homemade-pkgs.micro-nordcolors; + xdg.configFile."micro/plug/fzfinder".source = pkgs.my.micro-fzfinder; + xdg.configFile."micro/plug/kdl".source = pkgs.my.micro-kdl; + xdg.configFile."micro/plug/nordcolors".source = pkgs.my.micro-nordcolors; xdg.configFile."micro/colorschemes" = { - source = "${homemade-pkgs.micro-catppuccin}/colorschemes"; + source = "${pkgs.my.micro-catppuccin}/colorschemes"; recursive = true; }; - xdg.configFile."micro/colorschemes/everforest.micro".source = "${homemade-pkgs.micro-everforest}/colorschemes/everforest.micro"; + xdg.configFile."micro/colorschemes/everforest.micro".source = "${pkgs.my.micro-everforest}/colorschemes/everforest.micro"; # Default keybinfings are https://github.com/zyedidia/micro/blob/master/runtime/help/keybindings.md xdg.configFile."micro/bindings.json".source = ../config/micro/bindings.json; # TODO: Consider to extract from nix managed, because of now also using in windows - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/micro.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/micro.nix # https://github.com/zyedidia/micro/blob/c15abea64c20066fc0b4c328dfabd3e6ba3253a0/runtime/help/options.md # keybinds: https://github.com/zyedidia/micro/blob/c15abea64c20066fc0b4c328dfabd3e6ba3253a0/runtime/help/defaultkeys.md programs.micro = { diff --git a/home-manager/packages.nix b/home-manager/packages.nix index 4ff262bf..32f6f4af 100644 --- a/home-manager/packages.nix +++ b/home-manager/packages.nix @@ -1,13 +1,8 @@ { pkgs, - edge-pkgs, - homemade-pkgs, ... }: -# Prefer stable pkgs as possible, if you want to use edge pkgs -# - Keep zero or tiny config in home-manager layer -# - Set `mod-name.package = edge-pkgs.the-one;` (with pkgs; [ # Use `bashInteractive`, don't `bash` - https://github.com/NixOS/nixpkgs/issues/29960, https://github.com/NixOS/nix/issues/730 # bash @@ -41,8 +36,8 @@ # gh # Don't add gh here. Only use home-manager gh module to avoid https://github.com/cli/cli/pull/5378 ghq - edge-pkgs.sequoia-sq # Alt `gpg` - nixos-24.05 does not backport recent versions and the older requires to rebuild. https://github.com/NixOS/nixpkgs/pull/331099 - edge-pkgs.sequoia-chameleon-gnupg + sequoia-sq # Alt `gpg` + sequoia-chameleon-gnupg gnupg # Also keep original GPG for now. sequoia-chameleon-gnupg does not support some crucial toolset. etc: `gpg --edit-key`, `gpgconf` age # Candidates: rage @@ -51,7 +46,7 @@ gopass # They will respect pass comaptibility: https://github.com/gopasspw/gopass/issues/1365#issuecomment-719655627 # Age fork of `pass`, also supports rage with $PASSAGE_AGE. - edge-pkgs.passage # Use latest to apply https://github.com/NixOS/nixpkgs/pull/339113 + passage # Do not specify vim and the plugins at here, it made collisions from home-manager vim module. # See following issues @@ -59,12 +54,14 @@ # - https://discourse.nixos.org/t/home-manager-neovim-collision/16963/2 micro + unstable.ox # modeless editor. tree eza # alt ls curl wget jq + jnv # interactive jq ripgrep # `rg` bat # alt cat mdcat # pipe friendly markdown viewer rather than glow @@ -107,7 +104,7 @@ # - Apertium - does not support Japanese translate-shell # `echo "$text" | trans en:ja` ]) -++ (with homemade-pkgs; [ +++ (with pkgs.my; [ la lat fzf-bind-posix-shell-history-to-git-commit-message diff --git a/home-manager/ssh.nix b/home-manager/ssh.nix index f695acc9..eb6c1f09 100644 --- a/home-manager/ssh.nix +++ b/home-manager/ssh.nix @@ -1,6 +1,5 @@ { pkgs, - edge-pkgs, config, ... }: @@ -20,7 +19,7 @@ in # - id_*: Do NOT share in different machines, do NOT tell to anyone. They are secrets. # - id_*.pub: I CAN register them for different services. { - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/services/ssh-agent.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/services/ssh-agent.nix services.ssh-agent.enable = pkgs.stdenv.isLinux; home.sessionVariables = { @@ -31,15 +30,18 @@ in name = "ssh-ask-pass"; text = "gopass show ssh-pass"; meta.description = "GH-714. Required to be wrapped with one command because of SSH_ASKPASS does not accept arguments."; - runtimeInputs = (with pkgs; [ gopass ]) ++ (with edge-pkgs; [ sequoia-chameleon-gnupg ]); + runtimeInputs = with pkgs; [ + gopass + sequoia-chameleon-gnupg + ]; runtimeEnv = { - GOPASS_GPG_BINARY = "${pkgs.lib.getBin edge-pkgs.sequoia-chameleon-gnupg}/bin/gpg-sq"; + GOPASS_GPG_BINARY = "${pkgs.lib.getBin pkgs.sequoia-chameleon-gnupg}/bin/gpg-sq"; }; } ); }; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/ssh.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/ssh.nix programs.ssh = { enable = true; diff --git a/home-manager/systemd.nix b/home-manager/systemd.nix index 2dd17af1..937f5f77 100644 --- a/home-manager/systemd.nix +++ b/home-manager/systemd.nix @@ -1,7 +1,7 @@ { pkgs, lib, ... }: { - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/systemd.nix#L161-L173 + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/systemd.nix#L161-L173 systemd = { user = { # Enable locale for GNOME and terminals in the gnome-shell. Linux VT console respects home.sessionVariables instead diff --git a/home-manager/terminals.nix b/home-manager/terminals.nix index 13b55a0e..5000a898 100644 --- a/home-manager/terminals.nix +++ b/home-manager/terminals.nix @@ -14,11 +14,11 @@ }; }; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/kitty.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/kitty.nix programs.kitty = { enable = true; package = pkgs.emptyDirectory; - theme = "zenwritten_dark"; + themeFile = "zenwritten_dark"; # basename in a file of https://github.com/kovidgoyal/kitty-themes/tree/master/themes settings = { shell = lib.getExe pkgs.zsh; cursor_shape = "beam"; diff --git a/home-manager/vim.nix b/home-manager/vim.nix index ffe208ed..62e0eb14 100644 --- a/home-manager/vim.nix +++ b/home-manager/vim.nix @@ -1,26 +1,23 @@ { pkgs, config, - edge-pkgs, ... }: { - # TODO: Prefer xdg.stateFile since home-manager release-24.11. See https://github.com/nix-community/home-manager/pull/5779 - home.file."${config.xdg.stateHome}/vim/.keep".text = "Keep this directory because of home-manager and vim does not create the file if directory is missing"; + xdg.stateFile."vim/.keep".text = "Keep this directory because of home-manager and vim does not create the file if directory is missing"; - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/vim.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/vim.nix # https://nixos.wiki/wiki/Vim programs.vim = { # Enabling this may cause colisions. Do not add in packages list enable = true; # nix-env -f '' -qaP -A vimPlugins - plugins = - (with pkgs.vimPlugins; [ - iceberg-vim - fzf-vim - ]) - ++ [ edge-pkgs.vimPlugins.kdl-vim ]; + plugins = with pkgs.vimPlugins; [ + iceberg-vim + fzf-vim + kdl-vim + ]; settings = { background = "dark"; diff --git a/home-manager/wsl.nix b/home-manager/wsl.nix index db0d07c4..be123d18 100644 --- a/home-manager/wsl.nix +++ b/home-manager/wsl.nix @@ -5,7 +5,7 @@ let in { - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/systemd.nix#L161-L173 + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/systemd.nix#L161-L173 # Originally "system" should be better than "user", but it is not a home-manager role systemd.user = commonSystemd.systemd.user // { # - This name should be same of Mount.Where. Do not use `-` except path separator diff --git a/home-manager/zsh.nix b/home-manager/zsh.nix index b1e7268a..50a48a58 100644 --- a/home-manager/zsh.nix +++ b/home-manager/zsh.nix @@ -2,8 +2,6 @@ config, lib, pkgs, - homemade-pkgs, - edge-pkgs, ... }: @@ -33,7 +31,7 @@ in # https://nixos.wiki/wiki/Zsh # https://zsh.sourceforge.io/Doc/Release/Options.html - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/zsh.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/zsh.nix # You should consider the loading order: https://medium.com/@rajsek/zsh-bash-startup-files-loading-order-bashrc-zshrc-etc-e30045652f2e programs.zsh = { enable = true; @@ -235,7 +233,7 @@ in source "${pkgs.kind}/share/zsh/site-functions/_kind" # cargo-make recommends to use bash completions for zsh # Update after intoducing https://github.com/sagiegurari/cargo-make/pull/1182 - source "${edge-pkgs.cargo-make}/share/bash-completion/completions/makers-completion.bash" + source "${pkgs.cargo-make}/share/bash-completion/completions/makers-completion.bash" # fzf completions are also possible to be used in bash, but it overrides default completions with the registering # So currently injecting only in zsh @@ -292,7 +290,7 @@ in . "$@" } - source_sh "${homemade-pkgs.posix_shared_functions}" + source_sh "${pkgs.my.posix_shared_functions}" if [ 'linux' = "$TERM" ]; then # Avoid Tofu diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 17cdd377..4e8cb2c1 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -4,15 +4,13 @@ { pkgs, - edge-pkgs, - homemade-pkgs, lib, + overlays, ... }: { imports = [ - ./modules/cloudflare-warp.nix - (import ./console.nix { inherit homemade-pkgs; }) + (import ./console.nix { inherit pkgs; }) ]; nix.settings.experimental-features = [ @@ -29,7 +27,7 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "24.05"; # Did you read the comment? + system.stateVersion = "24.11"; # Did you read the comment? # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. @@ -37,11 +35,11 @@ # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/networking/networkmanager.nix + # https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/modules/services/networking/networkmanager.nix networking.networkmanager = { enable = true; - # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/networking/networkmanager.nix#L261-L289 + # https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/modules/services/networking/networkmanager.nix#L261-L289 wifi = { # https://github.com/kachick/dotfiles/issues/663#issuecomment-2262189168 powersave = false; @@ -51,9 +49,17 @@ # TODO: Reconsider to set UTC for servers time.timeZone = "Asia/Tokyo"; - # Allow unfree packages - # Be careful to deploy containers if true, and it may take longtime in CI for non binary caches - nixpkgs.config.allowUnfree = true; + nixpkgs = { + inherit overlays; + + # Allow unfree packages + # Be careful to deploy containers if true, and it may take longtime in CI for non binary caches + config.allowUnfree = true; + }; + + # https://github.com/NixOS/nixpkgs/blob/8e5e5a6add04c7f1e38e76f59ada6732947f1e55/nixos/doc/manual/release-notes/rl-2411.section.md?plain=1#L69-L76 + # Disabling to avoid `SC2174` in for '/nix/store/h93h6srxzslr8kyv13klrq63zd6ymhxy-unit-script-cups-pre-start.drv' + systemd.enableStrictShellChecks = false; # TODO: Reconsider to drop this services.packagekit = { @@ -64,7 +70,6 @@ hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot # Enable sound with pipewire. - sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { @@ -82,8 +87,6 @@ services.cloudflare-warp = { enable = true; - # Use newer version to break down issues such as GH-749 - package = edge-pkgs.cloudflare-warp; }; environment.variables = { diff --git a/nixos/console.nix b/nixos/console.nix index 65aaca61..9ff1f8c4 100644 --- a/nixos/console.nix +++ b/nixos/console.nix @@ -1,14 +1,14 @@ -{ homemade-pkgs, ... }: +{ pkgs, ... }: { - # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/config/console.nix + # https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/modules/config/console.nix # https://wiki.archlinux.org/title/Linux_console console = { earlySetup = true; # The font should have PSF formats. Do not specify TTF and OTF # You can list current glyphs with `showconsolefont` - font = "${homemade-pkgs.cozette}/share/consolefonts/cozette_hidpi.psf"; + font = "${pkgs.my.cozette}/share/consolefonts/cozette_hidpi.psf"; - packages = with homemade-pkgs; [ cozette ]; + packages = with pkgs.my; [ cozette ]; keyMap = "us"; # Applying iceberg for 16(0-15) console colors diff --git a/nixos/desktop/default.nix b/nixos/desktop/default.nix index 830e6483..ac1a1c84 100644 --- a/nixos/desktop/default.nix +++ b/nixos/desktop/default.nix @@ -2,15 +2,13 @@ config, inputs, pkgs, - edge-pkgs, - homemade-pkgs, lib, ... }: { imports = [ - (import ./font.nix { inherit pkgs homemade-pkgs; }) + (import ./font.nix { inherit pkgs; }) inputs.xremap-flake.nixosModules.default ./xremap.nix ]; @@ -45,15 +43,15 @@ # Don't use other DM like SDDM, LightDM, lemurs for now. They don't start GNOME for now... (AFAIK) # And when I was using KDE, GDM only worked, SDDM didn't work - # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/x11/display-managers/gdm.nix + # https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/modules/services/x11/display-managers/gdm.nix displayManager.gdm.enable = true; - # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/x11/display-managers/lightdm.nix + # https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/modules/services/x11/display-managers/lightdm.nix # displayManager.lightdm.enable = false; desktopManager.gnome = { enable = true; # https://github.com/NixOS/nixpkgs/issues/114514 - extraGSettingsOverridePackages = [ pkgs.gnome.mutter ]; + extraGSettingsOverridePackages = [ pkgs.mutter ]; }; # Configure keymap in X11 @@ -64,7 +62,7 @@ }; services.udev.packages = with pkgs; [ - gnome.gnome-settings-daemon + gnome-settings-daemon sane-airscan ]; @@ -78,24 +76,21 @@ programs.virt-manager.enable = true; programs = { - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/misc/dconf.nix#L39-L42 + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/misc/dconf.nix#L39-L42 dconf.enable = true; # For lanching with command looks like better than alacritty gnome-terminal.enable = true; }; - environment.gnome.excludePackages = - (with pkgs; [ - gnome-tour - gnome-connections - ]) - ++ (with pkgs.gnome; [ - epiphany # web browser - geary # email reader - evince # document viewer - gnome-calendar - gnome-music # does not support flac by defaults - ]); + environment.gnome.excludePackages = with pkgs; [ + gnome-tour + gnome-connections + epiphany # web browser + geary # email reader + evince # document viewer + gnome-calendar + gnome-music # does not support flac by defaults + ]; # Recommended to be uninstalled by gnupg. I prefer this way, even though disabling gpg-agent ssh integrations. # https://wiki.gnupg.org/GnomeKeyring @@ -129,20 +124,7 @@ }; environment.systemPackages = - [ - # version in nixos-24.05 does not enable IME - # Don't use `buildFHSEnv` even through want to apply LSP smart. See GH-809 - edge-pkgs.zed-editor - - edge-pkgs.podman-desktop - - edge-pkgs.cyme # Frequently updated - - edge-pkgs.gdm-settings # Useable since https://github.com/NixOS/nixpkgs/pull/335233 - - edge-pkgs.alacritty # Use latest schema as Windows. GH-918 - ] - ++ (with pkgs; [ + (with pkgs; [ firefox # https://github.com/NixOS/nixpkgs/issues/33282 @@ -151,12 +133,16 @@ foot kitty - # TODO: Reconsider to drop this - skk-dicts - skktools - + cyme lshw + # Don't use `buildFHSEnv` even through want to apply LSP smart. See GH-809 + zed-editor + + gdm-settings + + alacritty + lapce # IME is not working on Windows, but stable even around IME on Wayland than vscode # Add LSP global for zed-editor. Prefer external package for helix @@ -174,8 +160,8 @@ calibre - gnome.dconf-editor - gnome.gnome-boxes + dconf-editor + gnome-boxes # https://github.com/NixOS/nixpkgs/issues/174353 - Super + / runs launcher by default pop-launcher @@ -184,12 +170,14 @@ lima + podman-desktop + ## Unfree packages # TODO: Add `"--wayland-text-input-version=3"` after vscode updates the Electron to 33.0.0 or higher. See GH-689 for detail. # TODO: Consider using vscodium again # Don't use unstable channel. It frequently backported to stable channel - # - https://github.com/NixOS/nixpkgs/commits/nixos-24.05/pkgs/applications/editors/vscode/vscode.nix + # - https://github.com/NixOS/nixpkgs/commits/nixos-24.11/pkgs/applications/editors/vscode/vscode.nix (vscode.override (prev: { # https://wiki.archlinux.org/title/Wayland#Electron # https://github.com/NixOS/nixpkgs/blob/3f8b7310913d9e4805b7e20b2beabb27e333b31f/pkgs/applications/editors/vscode/generic.nix#L207-L214 @@ -204,14 +192,14 @@ })) # Don't use unstable channel. It frequently backported to stable channel - # - https://github.com/NixOS/nixpkgs/commits/nixos-24.05/pkgs/by-name/go/google-chrome/package.nix + # - https://github.com/NixOS/nixpkgs/commits/nixos-24.11/pkgs/by-name/go/google-chrome/package.nix # - Actually unstable is/was broken. See GH-776 # # if you changed hostname and chrome doesn't run, see https://askubuntu.com/questions/476918/google-chrome-wont-start-after-changing-hostname # `rm -rf ~/.config/google-chrome/Singleton*` (google-chrome.override (prev: { # https://wiki.archlinux.org/title/Chromium#Native_Wayland_support - # Similar as https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/chromium.nix + # Similar as https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/chromium.nix commandLineArgs = (prev.commandLineArgs or [ ]) ++ [ "--enable-features=UseOzonePlatform" "--ozone-platform=wayland" @@ -248,7 +236,7 @@ environment.etc."gdm/PostLogin/Default".source = lib.getExe ( pkgs.writeShellApplication { name = "connect_cloudflare-warp"; - runtimeInputs = with edge-pkgs; [ cloudflare-warp ]; + runtimeInputs = with pkgs; [ cloudflare-warp ]; text = '' warp-cli connect ''; @@ -256,7 +244,7 @@ ); environment.variables = { - VISUAL = "${lib.getExe edge-pkgs.zed-editor} --wait"; + VISUAL = "${lib.getExe pkgs.zed-editor} --wait"; XMODIFIERS = "@im=fcitx"; # Required in both GNOME and KDE @@ -291,7 +279,7 @@ VIDEOS=Videos ''; - # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/programs/firefox.nix + # https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/modules/programs/firefox.nix programs.firefox = { enable = true; languagePacks = [ @@ -302,10 +290,11 @@ i18n = { inputMethod = { - enabled = "fcitx5"; + enable = true; + type = "fcitx5"; fcitx5.addons = [ - pkgs.fcitx5-mozc + pkgs.unstable.fcitx5-mozc # TODO: Prefer stable after https://github.com/NixOS/nixpkgs/pull/356590 included pkgs.fcitx5-gtk ]; diff --git a/nixos/desktop/font.nix b/nixos/desktop/font.nix index 6a01ed03..edf96b9b 100644 --- a/nixos/desktop/font.nix +++ b/nixos/desktop/font.nix @@ -1,4 +1,4 @@ -{ pkgs, homemade-pkgs, ... }: +{ pkgs, ... }: { fonts = { enableDefaultPackages = true; @@ -30,12 +30,12 @@ ]) ++ [ # emoji - homemade-pkgs.beedii + pkgs.my.beedii ]; # Same as home-manager module? # https://github.com/nix-community/home-manager/issues/605 - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/misc/fontconfig.nix + # https://github.com/nix-community/home-manager/blob/release-24.11/modules/misc/fontconfig.nix fontconfig = { enable = true; hinting.enable = true; diff --git a/nixos/hosts/moss/fingerprint.nix b/nixos/hosts/moss/fingerprint.nix index ec2adf55..bd8219ae 100644 --- a/nixos/hosts/moss/fingerprint.nix +++ b/nixos/hosts/moss/fingerprint.nix @@ -10,7 +10,7 @@ enable = true; # This select is a bit different of https://github.com/ramaureirac/thinkpad-e14-linux/blob/7539f51b1c29d116a549265f992032aa9642d4a5/tweaks/fingerprint/README.md#L19 # You should check actual vendor with `lsusb | grep FingerPrint` - # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/pkgs/development/libraries/libfprint-2-tod1-goodix-550a/default.nix#L9 + # https://github.com/NixOS/nixpkgs/blob/nixos-24.11/pkgs/development/libraries/libfprint-2-tod1-goodix-550a/default.nix#L9 driver = pkgs.libfprint-2-tod1-goodix-550a; }; diff --git a/nixos/hosts/wsl/default.nix b/nixos/hosts/wsl/default.nix index b66b8ddc..6f19b122 100644 --- a/nixos/hosts/wsl/default.nix +++ b/nixos/hosts/wsl/default.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, ... }: +{ inputs, ... }: { networking.hostName = "wsl"; @@ -19,6 +19,5 @@ # Required to run VSCode Remote server programs.nix-ld = { enable = true; - package = pkgs.nix-ld-rs; # TODO: Remove since NixOS 24.11 }; } diff --git a/nixos/modules/cloudflare-warp.nix b/nixos/modules/cloudflare-warp.nix deleted file mode 100644 index 0428fbcb..00000000 --- a/nixos/modules/cloudflare-warp.nix +++ /dev/null @@ -1,100 +0,0 @@ -# TODO: Replace nixpkgs official module since 24.11 -# This code is imported from https://github.com/nixos/nixpkgs/blob/nixos-unstable/nixos/modules/services/networking/cloudflare-warp.nix -# to apply for 24.05 easy -{ - config, - lib, - pkgs, - ... -}: -let - cfg = config.services.cloudflare-warp; -in -{ - options.services.cloudflare-warp = { - enable = lib.mkEnableOption "Cloudflare Zero Trust client daemon"; - - package = lib.mkPackageOption pkgs "cloudflare-warp" { }; - - rootDir = lib.mkOption { - type = lib.types.str; - default = "/var/lib/cloudflare-warp"; - description = '' - Working directory for the warp-svc daemon. - ''; - }; - - udpPort = lib.mkOption { - type = lib.types.port; - default = 2408; - description = '' - The UDP port to open in the firewall. Warp uses port 2408 by default, but fallback ports can be used - if that conflicts with another service. See the [firewall documentation](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/firewall#warp-udp-ports) - for the pre-configured available fallback ports. - ''; - }; - - openFirewall = lib.mkEnableOption "opening UDP ports in the firewall" // { - default = true; - }; - }; - - config = lib.mkIf cfg.enable { - environment.systemPackages = [ cfg.package ]; - - networking.firewall = lib.mkIf cfg.openFirewall { allowedUDPPorts = [ cfg.udpPort ]; }; - - systemd.tmpfiles.rules = [ - "d ${cfg.rootDir} - root root" - "z ${cfg.rootDir} - root root" - ]; - - systemd.services.cloudflare-warp = { - enable = true; - description = "Cloudflare Zero Trust Client Daemon"; - - # lsof is used by the service to determine which UDP port to bind to - # in the case that it detects collisions. - path = [ pkgs.lsof ]; - requires = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - - serviceConfig = - let - caps = [ - "CAP_NET_ADMIN" - "CAP_NET_BIND_SERVICE" - "CAP_SYS_PTRACE" - ]; - in - { - Type = "simple"; - ExecStart = "${cfg.package}/bin/warp-svc"; - ReadWritePaths = [ - "${cfg.rootDir}" - "/etc/resolv.conf" - ]; - CapabilityBoundingSet = caps; - AmbientCapabilities = caps; - Restart = "always"; - RestartSec = 5; - Environment = [ "RUST_BACKTRACE=full" ]; - WorkingDirectory = cfg.rootDir; - - # See the systemd.exec docs for the canonicalized paths, the service - # makes use of them for logging, and account state info tracking. - # https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#RuntimeDirectory= - StateDirectory = "cloudflare-warp"; - RuntimeDirectory = "cloudflare-warp"; - LogsDirectory = "cloudflare-warp"; - - # The service needs to write to /etc/resolv.conf to configure DNS, so that file would have to - # be world read/writable to run as anything other than root. - User = "root"; - Group = "root"; - }; - }; - }; - - meta.maintainers = with lib.maintainers; [ treyfortmuller ]; -} diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 00000000..73b12aba --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,14 @@ +{ edge-nixpkgs, ... }: +[ + (final: _prev: { + my = import ../pkgs { + pkgs = final.pkgs; + }; + }) + + (final: _prev: { + unstable = import edge-nixpkgs { + system = final.system; + }; + }) +] diff --git a/pkgs/check_nixf/default.nix b/pkgs/check_nixf/default.nix index 81483aa5..ea466b30 100644 --- a/pkgs/check_nixf/default.nix +++ b/pkgs/check_nixf/default.nix @@ -1,15 +1,13 @@ -{ pkgs, edge-pkgs, ... }: +{ pkgs, ... }: pkgs.writeShellApplication rec { name = "check_nixf"; text = builtins.readFile ./${name}.bash; - runtimeInputs = - with pkgs; - [ - git - findutils # `xargs` - gnugrep - ] - ++ [ edge-pkgs.nixf ]; + runtimeInputs = with pkgs; [ + nixf + git + findutils # `xargs` + gnugrep + ]; # Removing "errexit" for using grep to check empty result. See https://github.com/kachick/times_kachick/issues/278 bashOptions = [ "nounset" diff --git a/pkgs/default.nix b/pkgs/default.nix index d15fbcd4..847d7dc3 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,11 +1,11 @@ -{ pkgs, edge-pkgs, ... }: +{ pkgs, ... }: { bump_completions = import ./bump_completions { inherit pkgs; }; bump_gomod = import ./bump_gomod { inherit pkgs; }; - check_nixf = import ./check_nixf { inherit pkgs edge-pkgs; }; + check_nixf = import ./check_nixf { inherit pkgs; }; safe_quote_backtik = import ./safe_quote_backtik { inherit pkgs; };