Skip to content

Commit

Permalink
Merge pull request #600 from kachick/nixpkgs-release-24.05
Browse files Browse the repository at this point in the history
Update to NixOS 24.05 release channel
  • Loading branch information
kachick committed May 23, 2024
2 parents ed733cf + bca9a29 commit d28a8e6
Show file tree
Hide file tree
Showing 15 changed files with 115 additions and 150 deletions.
7 changes: 0 additions & 7 deletions config/mise/config.toml

This file was deleted.

16 changes: 8 additions & 8 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 16 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
# - 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-23.11";
# TODO: s/release-24.05/nixos-24.05/ after nixpkgs branch off it
# - https://discourse.nixos.org/t/differences-between-nix-channels/13998/2?u=kachick
# - https://github.com/NixOS/nixpkgs/issues/303285
nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
edge-nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# https://github.com/nix-community/home-manager/blob/release-23.11/docs/manual/nix-flakes.md
# https://github.com/nix-community/home-manager/blob/release-24.05/docs/manual/nix-flakes.md
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
Expand All @@ -22,7 +25,7 @@
home-manager,
}:
let
# Candidates: https://github.com/NixOS/nixpkgs/blob/release-23.11/lib/systems/flake-systems.nix
# Candidates: https://github.com/NixOS/nixpkgs/blob/release-24.05/lib/systems/flake-systems.nix
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
"x86_64-darwin"
Expand All @@ -36,7 +39,7 @@
# - 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: edge-nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);

devShells = forAllSystems (
system:
Expand All @@ -51,8 +54,8 @@
buildInputs = [
# https://github.com/NixOS/nix/issues/730#issuecomment-162323824
bashInteractive
edge-pkgs.nixfmt-rfc-style
edge-pkgs.nil
nixfmt-rfc-style
nil
# To get sha256 around pkgs.fetchFromGitHub in CLI
nix-prefetch-git
jq
Expand All @@ -62,12 +65,13 @@
gitleaks
cargo-make

edge-pkgs.dprint
dprint
# TODO: Use stable if https://github.com/google/yamlfmt/pull/179 is released
edge-pkgs.yamlfmt
edge-pkgs.typos
edge-pkgs.go_1_22
edge-pkgs.goreleaser
edge-pkgs.trivy
typos
go_1_22
goreleaser
trivy
];
};
}
Expand Down
18 changes: 6 additions & 12 deletions home-manager/bash.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
config,
lib,
pkgs,
edge-pkgs,
...
}:

Expand All @@ -11,14 +10,13 @@
programs.starship.enableBashIntegration = true;
programs.direnv.enableBashIntegration = true;
programs.zoxide.enableBashIntegration = true;
# TODO: I can enable since release-24.05: https://github.com/nix-community/home-manager/pull/5239
programs.fzf.enableBashIntegration = false;
# programs.mise.enableBashIntegration = true;
programs.fzf.enableBashIntegration = true;
programs.mise.enableBashIntegration = true;
# Intentionally disabled for keeping stable bash
programs.zellij.enableBashIntegration = false;

# Used only in bash - https://unix.stackexchange.com/a/689403
# https://github.com/nix-community/home-manager/blob/release-23.11/modules/programs/readline.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/readline.nix
programs.readline = {
enable = true;
variables = {
Expand All @@ -40,7 +38,7 @@
};
};

# https://github.com/nix-community/home-manager/blob/release-23.11/modules/programs/bash.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/bash.nix
programs.bash = {
enable = true;

Expand Down Expand Up @@ -108,7 +106,7 @@
'';

# For interactive shells. In .bashrc and after early return
# https://github.com/nix-community/home-manager/blob/release-23.11/modules/programs/bash.nix#L221-L222
# https://github.com/nix-community/home-manager/blob/release-24.05/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.
Expand All @@ -121,11 +119,7 @@
# shellcheck disable=SC2034
starship_precmd_user_func="set_win_title"
eval "$(${lib.getExe edge-pkgs.mise} activate bash)"
eval "$(${lib.getExe edge-pkgs.fzf} --bash)"
source "${edge-pkgs.fzf-git-sh}/share/fzf-git-sh/fzf-git.sh"
source "${pkgs.fzf-git-sh}/share/fzf-git-sh/fzf-git.sh"
source "${../dependencies/podman/completions.bash}"
source "${../dependencies/dprint/completions.bash}"
Expand Down
52 changes: 25 additions & 27 deletions home-manager/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
home.homeDirectory =
if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}";

# https://github.com/nix-community/home-manager/blob/release-23.11/modules/misc/xdg.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/misc/xdg.nix
xdg.enable = true;

home = {
Expand All @@ -34,7 +34,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 = "23.11";
stateVersion = "24.05";
enableNixpkgsReleaseCheck = true;

sessionVariables = {
Expand Down Expand Up @@ -70,7 +70,7 @@
};

# https://github.com/nix-community/home-manager/issues/605
# https://github.com/nix-community/home-manager/blob/release-23.11/modules/misc/fontconfig.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/misc/fontconfig.nix
fonts.fontconfig.enable = true;

# This also changes xdg? Official manual sed this config is better for non NixOS Linux
Expand Down Expand Up @@ -104,7 +104,6 @@
enable = true;

# Use same nixpkgs channel as same as fzf
package = edge-pkgs.zoxide;
};

# https://nixos.wiki/wiki/Home_Manager
Expand Down Expand Up @@ -175,13 +174,11 @@
# typos does not have global config feature, this is used in git hooks for https://github.com/kachick/dotfiles/issues/412
xdg.configFile."typos/_typos.toml".source = ../_typos.toml;

# https://github.com/nix-community/home-manager/blob/release-23.11/modules/programs/fzf.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/fzf.nix
# https://github.com/junegunn/fzf/blob/master/README.md
programs.fzf = rec {
enable = true;

package = edge-pkgs.fzf;

# https://github.com/junegunn/fzf/blob/d579e335b5aa30e98a2ec046cb782bbb02bc28ad/README.md#respecting-gitignore
defaultCommand = "${pkgs.fd}/bin/fd --type f --strip-cwd-prefix --hidden --follow --exclude .git";

Expand All @@ -207,28 +204,29 @@
};
};

# https://github.com/nix-community/home-manager/blob/release-23.11/modules/programs/starship.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/starship.nix
programs.starship = {
enable = true;
};

# TODO: Enable since release-24.05
# https://github.com/nix-community/home-manager/blob/master/modules/programs/mise.nix
# Current shell integrations should be refer
# - https://github.com/nix-community/home-manager/blob/30f2ec39519f4f5a8a96af808c439e730c15aeab/modules/programs/mise.nix#L97-L109
# programs.mise = {
# enable = true;
# globalConfig = {
# plugins = {
# # It is not registered in asdf-vm/plugins and does not appear to be actively maintained. So specify the ref here
# # https://github.com/tvon/asdf-podman/tree/974e0fbb6051aaea0a685d8b14587113dfba9173
# podman = "https://github.com/tvon/asdf-podman.git#974e0fbb6051aaea0a685d8b14587113dfba9173";
# };
# };
# };
xdg.configFile."mise/config.toml".source = ../config/mise/config.toml;

# https://github.com/nix-community/home-manager/blob/release-23.11/modules/programs/vim.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/mise.nix
programs.mise = {
enable = true;
globalConfig = {
plugins = {
# It is not registered in asdf-vm/plugins and does not appear to be actively maintained. So specify the ref here
# https://github.com/tvon/asdf-podman/tree/974e0fbb6051aaea0a685d8b14587113dfba9173
podman = "https://github.com/tvon/asdf-podman.git#974e0fbb6051aaea0a685d8b14587113dfba9173";
};
};
settings = {
status = {
missing_tools = "never";
};
};
};

# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/vim.nix
# https://nixos.wiki/wiki/Vim
programs.vim = {
enable = true;
Expand All @@ -244,7 +242,7 @@
'';
};

# https://github.com/nix-community/home-manager/blob/release-23.11/modules/programs/bat.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/bat.nix
programs.bat = {
enable = true;

Expand All @@ -258,7 +256,7 @@
};
};

# https://github.com/nix-community/home-manager/blob/release-23.11/modules/programs/zellij.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/zellij.nix
programs.zellij = {
enable = true;

Expand Down
18 changes: 4 additions & 14 deletions home-manager/fish.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
{
lib,
pkgs,
edge-pkgs,
...
}:
{ lib, pkgs, ... }:

{
services.gpg-agent.enableFishIntegration = true;
programs.starship.enableFishIntegration = true;
# Settled by default and readonly https://github.com/nix-community/home-manager/blob/8c731978f0916b9a904d67a0e53744ceff47882c/modules/programs/direnv.nix#L65-L68
# programs.direnv.enableFishIntegration = true;
programs.zoxide.enableFishIntegration = true;
# TODO: I can enable since release-24.05: https://github.com/nix-community/home-manager/pull/5239
programs.fzf.enableFishIntegration = false;
# programs.mise.enableFishIntegration = true;
programs.fzf.enableFishIntegration = true;
programs.mise.enableFishIntegration = true;
# Avoid nested zellij in host and remote login as container
programs.zellij.enableFishIntegration = false;

Expand All @@ -26,7 +20,7 @@
xdg.dataFile."fish/vendor_completions.d/podman.fish".source = ../dependencies/podman/completions.fish;
xdg.dataFile."fish/vendor_completions.d/dprint.fish".source = ../dependencies/dprint/completions.fish;

# https://github.com/nix-community/home-manager/blob/release-23.11/modules/programs/fish.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/fish.nix
programs.fish = {
enable = true;

Expand Down Expand Up @@ -58,10 +52,6 @@
functions --erase la
set -g fish_greeting
eval "$(${lib.getExe edge-pkgs.mise} activate fish)"
eval "$(${lib.getExe edge-pkgs.fzf} --fish)"
'';

plugins = [
Expand Down
13 changes: 6 additions & 7 deletions home-manager/git.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
pkgs,
edge-pkgs,
lib,
config,
...
Expand All @@ -16,7 +15,7 @@ let
runtimeInputs =
with pkgs;
[
edge-pkgs.fzf
fzf
coreutils
git
gh
Expand All @@ -27,7 +26,7 @@ let
wslu # WSL helpers like `wslview`. It is used in open browser features in gh command
]);
text = ''
# source nixpkgs file does not work here: source "${edge-pkgs.fzf-git-sh}/share/fzf-git-sh/fzf-git.sh"
# source nixpkgs file does not work here: source "${pkgs.fzf-git-sh}/share/fzf-git-sh/fzf-git.sh"
# https://github.com/junegunn/fzf-git.sh/blob/0f1e52079ffd9741eec723f8fd92aa09f376602f/fzf-git.sh#L118C1-L125C2
_fzf_git_fzf() {
fzf-tmux -p80%,60% -- \
Expand All @@ -54,7 +53,7 @@ in
{
home.file."repos/.keep".text = "Put repositories here";

# https://github.com/nix-community/home-manager/blob/release-23.11/modules/programs/git.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/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;
Expand All @@ -81,7 +80,7 @@ in
pkgs.writeShellApplication {
name = "prevent_typos_in_commit_mssage.bash";
meta.description = "#325";
runtimeInputs = [ edge-pkgs.typos ];
runtimeInputs = with pkgs; [ typos ];
text = ''
typos --config "${config.xdg.configHome}/typos/_typos.toml" "$1"
'';
Expand All @@ -94,7 +93,7 @@ in
meta.description = "#540";
runtimeInputs = with pkgs; [
git
edge-pkgs.typos
typos
];
# What arguments: https://git-scm.com/docs/githooks#_post_checkout
text = ''
Expand Down Expand Up @@ -194,7 +193,7 @@ in
};
};

# https://github.com/nix-community/home-manager/blob/release-23.11/modules/programs/gh.nix
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/gh.nix
programs.gh = {
enable = true;

Expand Down
Loading

0 comments on commit d28a8e6

Please sign in to comment.