Don't depend on external nixos-unstable channel
modules can now use unstablePkgs argument
This commit is contained in:
parent
fca3744086
commit
ffb6be2ea2
4 changed files with 51 additions and 13 deletions
|
@ -1,9 +1,9 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, unstablePkgs, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
unstable = import <nixos-unstable> { config = config.nixpkgs.config; };
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./unstable-packages.nix
|
||||||
|
];
|
||||||
users.users.wroclaw = {
|
users.users.wroclaw = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "Rafał";
|
description = "Rafał";
|
||||||
|
@ -20,7 +20,7 @@ in
|
||||||
firefox
|
firefox
|
||||||
vivaldi
|
vivaldi
|
||||||
discord-canary
|
discord-canary
|
||||||
unstable.vscode
|
unstablePkgs.vscode
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
users.groups.wroclaw.gid = 1000;
|
users.groups.wroclaw.gid = 1000;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{lib, config, pkgs, ...}:
|
{lib, config, pkgs, unstablePkgs, ...}:
|
||||||
|
|
||||||
let
|
|
||||||
unstable = import <nixos-unstable> {};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
../unstable-packages.nix
|
||||||
|
];
|
||||||
config = rec {
|
config = rec {
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
services.xserver.desktopManager.gnome.enable = true;
|
services.xserver.desktopManager.gnome.enable = true;
|
||||||
|
@ -207,7 +207,7 @@ in
|
||||||
gnomeExtensions.tray-icons-reloaded
|
gnomeExtensions.tray-icons-reloaded
|
||||||
gnomeExtensions.color-picker
|
gnomeExtensions.color-picker
|
||||||
gnomeExtensions.top-bar-organizer
|
gnomeExtensions.top-bar-organizer
|
||||||
# unstable.gnomeExtensions.translate-indicator
|
# unstablePkgs.gnomeExtensions.translate-indicator
|
||||||
# translate-shell
|
# translate-shell
|
||||||
pavucontrol
|
pavucontrol
|
||||||
#FIXME: Apply the cursor theme also in GTK3 config
|
#FIXME: Apply the cursor theme also in GTK3 config
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, unstablePkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
unstable = import <nixos-unstable> {};
|
|
||||||
rangerGit = pkgs.ranger.overrideAttrs (old: {
|
rangerGit = pkgs.ranger.overrideAttrs (old: {
|
||||||
version = "git";
|
version = "git";
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
|
@ -20,6 +19,9 @@ let
|
||||||
});
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./unstable-packages.nix
|
||||||
|
];
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
rangerGit
|
rangerGit
|
||||||
kitty
|
kitty
|
||||||
|
@ -50,7 +52,7 @@ in
|
||||||
set vcs_aware true
|
set vcs_aware true
|
||||||
set show_hidden true
|
set show_hidden true
|
||||||
|
|
||||||
alias drag shell ${unstable.ripdrag}/bin/ripdrag -Axd %p &
|
alias drag shell ${unstablePkgs.ripdrag}/bin/ripdrag -Axd %p &
|
||||||
map <C-d> drag
|
map <C-d> drag
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
36
nix-os/unstable-packages.nix
Normal file
36
nix-os/unstable-packages.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{config, pkgs, lib, ...}:
|
||||||
|
|
||||||
|
let
|
||||||
|
nixos-unstable-exprs = builtins.fetchTarball https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz;
|
||||||
|
nixos-unstable = import nixos-unstable-exprs {
|
||||||
|
inherit (config.nixpkgs) config localSystem crossSystem;
|
||||||
|
overlays = if config.unstable.usePkgsOverlays then config.pkgs.overlays else [];
|
||||||
|
};
|
||||||
|
nixos-unstable-version = builtins.concatStringsSep "." [
|
||||||
|
(builtins.readFile "${builtins.toString nixos-unstable-exprs}/.version")
|
||||||
|
(builtins.readFile "${builtins.toString nixos-unstable-exprs}/.version-suffix")
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.unstable = {
|
||||||
|
enable = lib.mkEnableOption (lib.mkDoc ''
|
||||||
|
use of unstable packages in configuration. You can use `unstablePkgs` in configuration modules
|
||||||
|
'') // { default = true; };
|
||||||
|
usePkgsOverlays = lib.mkEnableOption (lib.mkDoc ''
|
||||||
|
use overlays from `nixpkgs.overlays`
|
||||||
|
'');
|
||||||
|
pkgs = lib.mkOption {
|
||||||
|
default = if config.unstable.enable then nixos-unstable else pkgs;
|
||||||
|
description = lib.mkDoc ''
|
||||||
|
acts like pkgs, but it has unstable packages if `unstable.enable` is enabled.
|
||||||
|
You can also use `unstablePkgs` in module arguments.
|
||||||
|
'';
|
||||||
|
visible = true;
|
||||||
|
readOnly = true;
|
||||||
|
type = lib.types.pkgs;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config._module.args.unstablePkgs = config.unstable.pkgs;
|
||||||
|
# FIXME: move it to the system derivation output (overrideAttrs config.system.build.toplevel?)
|
||||||
|
config.environment.etc."NIXOS-UNSTABLE-VERSION".text = nixos-unstable-version;
|
||||||
|
}
|
Loading…
Reference in a new issue