From ab0520f6348243abb6e64ee14a72a72b6e14252c Mon Sep 17 00:00:00 2001 From: Kirill Date: Fri, 3 Apr 2026 22:24:57 +0300 Subject: [PATCH] fix: restrict to pkgs-stable and pkgs-pinned --- flake.nix | 37 +++++++++++++------------------ host/WhiteRaven/configuration.nix | 6 ++--- modules/host/vpn.nix | 4 ++-- modules/user/packages/desktop.nix | 4 ++-- user/common.nix | 6 ++--- 5 files changed, 25 insertions(+), 32 deletions(-) diff --git a/flake.nix b/flake.nix index 2fc865b..478e699 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,7 @@ ayugram-desktop.url = "github:/ayugram-port/ayugram-desktop/release?submodules=1"; ags.url = "github:Aylur/ags/3ed9737bdbc8fc7a7c7ceef2165c9109f336bff6"; - nixpkgs-fixed.url = "github:nixos/nixpkgs/ce01daebf8489ba97bd1609d185ea276efdeb121"; + nixpkgs-pinned.url = "github:nixos/nixpkgs/2d293cbfa5a793b4c50d17c05ef9e385b90edf6c"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11"; sops-nix.url = "github:Mic92/sops-nix"; @@ -48,28 +48,21 @@ flake = false; }; }; - - outputs = { self, nixpkgs, nixpkgs-stable, nixpkgs-fixed, home-manager, ... }@inputs: - - let - system = "x86_64-linux"; - in { - - nixosConfigurations = { - WhiteRaven = nixpkgs-stable.lib.nixosSystem { - specialArgs = { - pkgs-unstable = import nixpkgs { - inherit system; - config.allowUnfree = true; - }; - pkgs-fixed = import nixpkgs-fixed { - inherit system; - config.allowUnfree = true; - }; - inherit inputs system; - }; - modules = [ ./host/WhiteRaven/configuration.nix ]; + + outputs = { self, nixpkgs, nixpkgs-stable, nixpkgs-pinned, home-manager, ... }@inputs: let + system = "x86_64-linux"; + config = { allowUnfree = true; }; + mkHost = hostname: nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + pkgs-stable = import nixpkgs-stable { inherit system config; }; + pkgs-pinned = import nixpkgs-pinned { inherit system config; }; }; + modules = [ ./host/${hostname}/configuration.nix ]; + }; + in { + nixosConfigurations = { + WhiteRaven = mkHost "WhiteRaven"; }; }; } diff --git a/host/WhiteRaven/configuration.nix b/host/WhiteRaven/configuration.nix index 3894548..e1bf437 100644 --- a/host/WhiteRaven/configuration.nix +++ b/host/WhiteRaven/configuration.nix @@ -1,7 +1,7 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, pkgs-unstable, pkgs-fixed, lib, inputs, ... }: +{ config, pkgs, pkgs-stable, pkgs-pinned, lib, inputs, ... }: { imports = [ @@ -16,8 +16,8 @@ (import ../../user/common.nix { inherit config; inherit pkgs; - inherit pkgs-unstable; - inherit pkgs-fixed; + inherit pkgs-stable; + inherit pkgs-pinned; inherit lib; inherit inputs; name = "kirill"; diff --git a/modules/host/vpn.nix b/modules/host/vpn.nix index 09dae81..2f7b1fc 100644 --- a/modules/host/vpn.nix +++ b/modules/host/vpn.nix @@ -1,11 +1,11 @@ -{ pkgs, pkgs-unstable, config, inputs, ...}: { +{ pkgs, config, inputs, ...}: { systemd.services.v2raya = { enable = true; description = "v2rayA gui client"; after = [ "network.target" ]; serviceConfig = { Restart = "always"; - ExecStart = "${pkgs-unstable.v2raya}/bin/v2rayA"; + ExecStart = "${pkgs.v2raya}/bin/v2rayA"; }; path = with pkgs; [ iptables bash iproute2 ]; wantedBy = [ "multi-user.target" ]; diff --git a/modules/user/packages/desktop.nix b/modules/user/packages/desktop.nix index 235fb39..50020d9 100644 --- a/modules/user/packages/desktop.nix +++ b/modules/user/packages/desktop.nix @@ -1,6 +1,6 @@ -{ pkgs, inputs, pkgs-fixed, ... }: { +{ pkgs, inputs, pkgs-pinned, ... }: { home.packages = with pkgs; [ - pkgs-fixed.ayugram-desktop + pkgs-pinned.ayugram-desktop obs-studio mpv obsidian diff --git a/user/common.nix b/user/common.nix index 1c76903..d42c0ae 100644 --- a/user/common.nix +++ b/user/common.nix @@ -1,4 +1,4 @@ -{config, pkgs, pkgs-unstable, pkgs-fixed, lib, inputs, name, fullname ? name, ... }: { +{config, pkgs, pkgs-stable, pkgs-pinned, lib, inputs, name, fullname ? name, ... }: { imports = [ inputs.home-manager.nixosModules.home-manager { home-manager = { @@ -27,8 +27,8 @@ }; extraSpecialArgs = { inherit inputs; - pkgs-stable = pkgs; - inherit pkgs-fixed; + inherit pkgs-stable; + inherit pkgs-pinned; host = { name = config.networking.hostName; };