From c263d105290f96174bc166d6bc2dbddbadb77a70 Mon Sep 17 00:00:00 2001 From: Vo Quang Chien Date: Thu, 20 Jun 2024 10:17:07 +0700 Subject: [PATCH] feat: add nixpkgs-unstable instance --- flake.lock | 25 ++++++++++++++++++++----- flake.nix | 3 ++- home/default.nix | 4 ++-- home/lib.nix | 5 ++++- hosts/lib.nix | 5 +++++ nixos/default.nix | 6 +++++- 6 files changed, 38 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index b1a91394..4af34a18 100644 --- a/flake.lock +++ b/flake.lock @@ -58,16 +58,15 @@ "locked": { "lastModified": 1718437845, "narHash": "sha256-ZT7Oc1g4I4pHVGGjQFnewFVDRLH5cIZhEzODLz9YXeY=", - "owner": "nixos", + "owner": "NixOS", "repo": "nixpkgs", "rev": "752c634c09ceb50c45e751f8791cb45cb3d46c9e", "type": "github" }, "original": { - "owner": "nixos", + "id": "nixpkgs", "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" + "type": "indirect" } }, "nixpkgs-lib": { @@ -82,12 +81,28 @@ "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1718530797, + "narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b60ebf54c15553b393d144357375ea956f89e9a9", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, "root": { "inputs": { "catppuccin": "catppuccin", "flake-parts": "flake-parts", "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" } } }, diff --git a/flake.nix b/flake.nix index 762c9669..ab552ff4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,8 @@ { description = "2giosangmitom's NixOS configuration"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + nixpkgs.url = "nixpkgs/nixos-24.05"; + nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; catppuccin.url = "github:catppuccin/nix"; home-manager = { diff --git a/home/default.nix b/home/default.nix index 010bc869..aec89b5a 100644 --- a/home/default.nix +++ b/home/default.nix @@ -22,9 +22,9 @@ sessionVariables = {}; }; xdg = { - enable = true; + enable = false; mimeApps = { - enable = true; + enable = false; defaultApplications = {}; }; }; diff --git a/home/lib.nix b/home/lib.nix index 4ad01c72..2ebc8506 100644 --- a/home/lib.nix +++ b/home/lib.nix @@ -10,7 +10,10 @@ inputs.catppuccin.homeManagerModules.catppuccin ]; - extraSpecialArgs = { + extraSpecialArgs = let + pkgs-unstable = import inputs.nixpkgs-unstable {config.allowUnfree = true;}; + in { inherit inputs; + inherit pkgs-unstable; }; } diff --git a/hosts/lib.nix b/hosts/lib.nix index 910c0553..4446de71 100644 --- a/hosts/lib.nix +++ b/hosts/lib.nix @@ -29,6 +29,10 @@ extraModules ? [], }: let pkgs = import inputs.nixpkgs {inherit system;}; + pkgs-unstable = import inputs.nixpkgs-unstable { + inherit system; + config.allowUnfree = true; + }; inherit (pkgs.lib) mkOption types; in { ${host} = inputs.nixpkgs.lib.nixosSystem { @@ -67,6 +71,7 @@ { _module.args = { inherit inputs; + inherit pkgs-unstable; }; } ] diff --git a/nixos/default.nix b/nixos/default.nix index 19753f0f..f55d6351 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -1,5 +1,6 @@ { pkgs, + pkgs-unstable, config, ... }: { @@ -28,7 +29,10 @@ brave gh pavucontrol - ]; + ] + ++ (with pkgs-unstable; [ + vscode.fhs + ]); security.polkit.enable = true; programs.gnupg.agent = { enable = true;