From 1862ee44783104d1c1321b6aaa502a0061031542 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Wed, 3 Jul 2024 17:45:35 -0500 Subject: [PATCH] =?UTF-8?q?back=20to=2024.05=20=F0=9F=92=86=E2=99=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.lock | 33 ++++++++++++++----- flake.nix | 5 +-- nixos/home/jahanson/workstation.nix | 1 + nixos/home/modules/default.nix | 2 +- .../nixos/services/forgejo/default.nix | 7 ++-- nixos/overlays/default.nix | 25 +++++++------- nixos/overlays/go/default.nix | 13 ++++++++ nixos/overlays/talosctl/default.nix | 18 ++++++++++ nixos/overlays/talosctl/update.sh | 16 +++++++++ nixos/profiles/global/system.nix | 2 +- 10 files changed, 96 insertions(+), 26 deletions(-) create mode 100644 nixos/overlays/go/default.nix create mode 100644 nixos/overlays/talosctl/default.nix create mode 100755 nixos/overlays/talosctl/update.sh diff --git a/flake.lock b/flake.lock index 923b1fc..4877b36 100644 --- a/flake.lock +++ b/flake.lock @@ -118,16 +118,16 @@ ] }, "locked": { - "lastModified": 1719827439, - "narHash": "sha256-tneHOIv1lEavZ0vQ+rgz67LPNCgOZVByYki3OkSshFU=", + "lastModified": 1720042825, + "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", "owner": "nix-community", "repo": "home-manager", - "rev": "59ce796b2563e19821361abbe2067c3bb4143a7d", + "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", "type": "github" }, "original": { "owner": "nix-community", - "ref": "master", + "ref": "release-24.05", "repo": "home-manager", "type": "github" } @@ -318,6 +318,22 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1719848872, + "narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1709961763, @@ -336,16 +352,16 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1719848872, - "narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=", + "lastModified": 1717179513, + "narHash": "sha256-vboIEwIQojofItm2xGCdZCzW96U85l9nDW3ifMuAIdM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8", + "rev": "63dacb46bf939521bdc93981b4cbb7ecb58427a0", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "24.05", "repo": "nixpkgs", "type": "github" } @@ -475,6 +491,7 @@ "nix-vscode-extensions": "nix-vscode-extensions", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_3", + "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", "sops-nix": "sops-nix", "talhelper": "talhelper" diff --git a/flake.nix b/flake.nix index 35734e0..34341a6 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,8 @@ inputs = { # Nixpkgs and unstable - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/24.05"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # impermanence # https://github.com/nix-community/impermanence @@ -22,7 +23,7 @@ # home-manager - unstable # https://github.com/nix-community/home-manager home-manager = { - url = "github:nix-community/home-manager/master"; + url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/nixos/home/jahanson/workstation.nix b/nixos/home/jahanson/workstation.nix index a2b2c50..09538f2 100644 --- a/nixos/home/jahanson/workstation.nix +++ b/nixos/home/jahanson/workstation.nix @@ -33,6 +33,7 @@ with config; termius obsidian jetbrains.datagrip + # talosctl # cli brightnessctl diff --git a/nixos/home/modules/default.nix b/nixos/home/modules/default.nix index d1d6bc8..4060911 100644 --- a/nixos/home/modules/default.nix +++ b/nixos/home/modules/default.nix @@ -19,7 +19,7 @@ # Home-manager defaults config = { - home.stateVersion = "24.11"; + home.stateVersion = "24.05"; programs = { home-manager.enable = true; diff --git a/nixos/modules/nixos/services/forgejo/default.nix b/nixos/modules/nixos/services/forgejo/default.nix index 537f50d..014644c 100644 --- a/nixos/modules/nixos/services/forgejo/default.nix +++ b/nixos/modules/nixos/services/forgejo/default.nix @@ -76,9 +76,10 @@ in COOKIE_NAME = "session"; }; }; - secrets = { - mailer.PASSWD = config.sops.secrets."services/forgejo/smtp/password".path; - }; + mailerPasswordFile = config.sops.secrets."services/forgejo/smtp/password".path; + # secrets = { + # mailer.PASSWD = config.sops.secrets."services/forgejo/smtp/password".path; + # }; }; # sops sops.secrets."services/forgejo/smtp/password" = { diff --git a/nixos/overlays/default.nix b/nixos/overlays/default.nix index a0a1e0d..9bfb253 100644 --- a/nixos/overlays/default.nix +++ b/nixos/overlays/default.nix @@ -1,22 +1,25 @@ { inputs, ... }: let - warpTerminal = import ./warp-terminal { + warpTerminalOverlay = import ./warp-terminal { inherit (inputs.nixpkgs) lib; }; - termiusApp = import ./termius { }; + termiusOverlay = import ./termius { }; + talosctlOverlay = import ./talosctl { }; + goOverlay = import ./go { }; in { nur = inputs.nur.overlay; - warp-terminal = warpTerminal; - termius = termiusApp; + warp-terminal = warpTerminalOverlay; + termius = termiusOverlay; + # talosctl = talosctlOverlay; + # go = goOverlay; # The unstable nixpkgs set (declared in the flake inputs) will # be accessible through 'pkgs.unstable' - # great idea if I wasn't using unstable as my base. - # unstable-packages = final: _prev: { - # unstable = import inputs.nixpkgs-unstable { - # inherit (final) system; - # config.allowUnfree = true; - # }; - # }; + unstable-packages = final: _prev: { + unstable = import inputs.nixpkgs-unstable { + inherit (final) system; + config.allowUnfree = true; + }; + }; } diff --git a/nixos/overlays/go/default.nix b/nixos/overlays/go/default.nix new file mode 100644 index 0000000..92b9d11 --- /dev/null +++ b/nixos/overlays/go/default.nix @@ -0,0 +1,13 @@ +{ ... }: +let + finalVersion = "1.22.4"; +in +(final: prev: { + go = prev.go.overrideAttrs (oldAttrs: { + version = finalVersion; + src = prev.fetchurl { + url = "https://go.dev/dl/go${finalVersion}.src.tar.gz"; + hash = "sha256-/tcgZ45yinyjC6jR3tHKr+J9FgKPqwIyuLqOIgCPt4Q="; + }; + }); +}) \ No newline at end of file diff --git a/nixos/overlays/talosctl/default.nix b/nixos/overlays/talosctl/default.nix new file mode 100644 index 0000000..387d84a --- /dev/null +++ b/nixos/overlays/talosctl/default.nix @@ -0,0 +1,18 @@ +{ ...}: +let + finalVersion = "1.7.5"; +in +(final: prev: { + talosctl = prev.talosctl.overrideAttrs (oldAttrs: { + version = finalVersion; + src = prev.fetchFromGitHub { + owner = "siderolabs"; + repo = "talos"; + rev = "v${finalVersion}"; + hash = "sha256-lmDLlxiPyVhlSPplYkIaS5Uw19hir6XD8MAk8q+obhY="; + }; + passthru = oldAttrs.passthru // { + updateScript = ./update.sh; + }; + }); +}) \ No newline at end of file diff --git a/nixos/overlays/talosctl/update.sh b/nixos/overlays/talosctl/update.sh new file mode 100755 index 0000000..f10db73 --- /dev/null +++ b/nixos/overlays/talosctl/update.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env nix-shell +#!nix-shell -I nixpkgs=/etc/nix/inputs/nixpkgs/ -i bash -p curl jq common-updater-scripts gnused nix coreutils + +set -euo pipefail + +latestVersion="$(curl -s "https://api.github.com/repos/siderolabs/talos/releases?per_page=1" | jq -r ".[0].tag_name" | sed 's/^v//')" +currentVersion=$(nix-instantiate --eval -E "with import /etc/nix/inputs/nixpkgs {}; talosctl.version or (lib.getVersion talosctl)" | tr -d '"') + +if [[ "$currentVersion" == "$latestVersion" ]]; then + echo "talosctl is up-to-date: $currentVersion" + exit 0 +fi + +update-source-version talosctl "$latestVersion" + +$(nix-build . -A talosctl --no-out-link) \ No newline at end of file diff --git a/nixos/profiles/global/system.nix b/nixos/profiles/global/system.nix index be1040c..cee4eac 100644 --- a/nixos/profiles/global/system.nix +++ b/nixos/profiles/global/system.nix @@ -8,6 +8,6 @@ ''; # Do not change unless you know what you are doing - stateVersion = "24.11"; + stateVersion = "24.05"; }; }