Merge branch 'pr/nixpath-device-version' into 'master'

Pr/nixpath device version

See merge request steveeJ/infra!56
This commit is contained in:
steveej 2020-10-16 20:34:01 +00:00
commit 6d809d40fc
12 changed files with 79 additions and 54 deletions

View file

@ -15,7 +15,7 @@ update-default-versions:
esh -o ${outfile} ${template} esh -o ${outfile} ${template}
_get_nix_path versionsPath: _get_nix_path versionsPath:
echo $(set -x; nix-build --no-link --show-trace {{invocation_directory()}}/nix/default.nix -A channelSources --argstr versionsPath {{versionsPath}} --argstr rebuildarg "dummy") echo $(set -x; nix-build --no-link --show-trace {{invocation_directory()}}/nix/default.nix -A channelSources --argstr versionsPath {{versionsPath}})
_device recipe dir +moreargs="": _device recipe dir +moreargs="":
#!/usr/bin/env bash #!/usr/bin/env bash

View file

@ -1,31 +1,34 @@
{ versionsPath }: { versionsPath }:
{ let
channelSources = channelVersions = (import versionsPath);
mkChannelSource = channel:
let let
channelVersions = (import versionsPath); channelVersion = builtins.getAttr channel channelVersions;
mkChannelSource = channel: in builtins.fetchGit {
let # Descriptive name to make the store path easier to identify
channelVersion = builtins.getAttr channel channelVersions; name = "nixpkgs-channels-${channel}";
in builtins.fetchGit { url = if builtins.hasAttr "url" channelVersion
# Descriptive name to make the store path easier to identify then channelVersion."url"
name = "nixpkgs-channels-${channel}"; else "https://github.com/NixOS/nixpkgs-channels/"
url = if builtins.hasAttr "url" channelVersion ;
then channelVersion."url" ref = (builtins.getAttr channel channelVersions)."ref";
else "https://github.com/NixOS/nixpkgs-channels/" rev = (builtins.getAttr channel channelVersions)."rev";
; };
ref = (builtins.getAttr channel channelVersions)."ref"; nixPath = builtins.foldl' (sum: elem: sum +":" + builtins.concatStringsSep "=" elem) "" [
rev = (builtins.getAttr channel channelVersions)."rev"; [ "nixpkgs" (mkChannelSource "channelsNixosStable") ]
}; [ "nixos" (mkChannelSource "channelsNixosStable" + "/nixos") ]
nix_path = builtins.foldl' (sum: elem: sum +":" + builtins.concatStringsSep "=" elem) "" [ [ "channels-nixos-stable" (mkChannelSource "channelsNixosStable") ]
[ "nixpkgs" (mkChannelSource "channelsNixosStable") ] [ "channels-nixos-unstable" (mkChannelSource "channelsNixosUnstable") ]
[ "nixos" (mkChannelSource "channelsNixosStable" + "/nixos") ] [ "nixpkgs-master" (mkChannelSource "nixpkgsMaster") ]
[ "channels-nixos-stable" (mkChannelSource "channelsNixosStable") ] [ "home-manager-module" (mkChannelSource "homeManagerModule") ]
[ "channels-nixos-unstable" (mkChannelSource "channelsNixosUnstable") ] ];
[ "nixpkgs-master" (mkChannelSource "nixpkgsMaster") ] pkgs = import (mkChannelSource "channelsNixosStable") {};
[ "home-manager-module" (mkChannelSource "homeManagerModule") ] in
];
in (import (mkChannelSource "channelsNixosStable") {}).writeText "channels.rc" '' {
export NIX_PATH=${nix_path} inherit nixPath;
''; channelSources = pkgs.writeText "channels.rc" ''
} export NIX_PATH=${nixPath}
'';
}

View file

@ -1,3 +1,9 @@
{ pkgs }:
let
zshCurried = import ../programs/zsh.nix { inherit pkgs; };
in
{ pkgs { pkgs
, config , config
, ... }: , ... }:
@ -20,7 +26,7 @@ in {
../programs/libreoffice.nix ../programs/libreoffice.nix
../programs/neovim.nix ../programs/neovim.nix
../programs/pass.nix ../programs/pass.nix
../programs/zsh.nix zshCurried
]; ];
nixpkgs.config = { nixpkgs.config = {
@ -65,10 +71,6 @@ in {
PATH=pkgs.lib.concatStringsSep ":" [ PATH=pkgs.lib.concatStringsSep ":" [
"$HOME/.local/bin" "$HOME/.local/bin"
"$HOME/.cargo/bin"
"$HOME/.gem/ruby/2.3.0/bin"
"$HOME/.npm-packages/bin"
"$GOPATH/bin"
"$PATH" "$PATH"
]; ];
}; };

View file

@ -1,3 +1,9 @@
{ pkgs }:
let
zshCurried = import ../programs/zsh.nix { inherit pkgs; };
in
{ pkgs { pkgs
, config, , config,
... }: ... }:
@ -17,7 +23,7 @@ in {
../programs/libreoffice.nix ../programs/libreoffice.nix
../programs/neovim.nix ../programs/neovim.nix
../programs/pass.nix ../programs/pass.nix
../programs/zsh.nix zshCurried
]; ];
nixpkgs.config = { nixpkgs.config = {

View file

@ -1,3 +1,9 @@
{ pkgs }:
let
zshCurried = import ../programs/zsh.nix { inherit pkgs; };
in
{ pkgs { pkgs
, config , config
, ... }: , ... }:
@ -9,7 +15,7 @@ in {
../profiles/common.nix ../profiles/common.nix
../profiles/nix-channels.nix ../profiles/nix-channels.nix
../programs/neovim.nix ../programs/neovim.nix
../programs/zsh.nix zshCurried
]; ];
nixpkgs.config = { nixpkgs.config = {

View file

@ -1,13 +1,8 @@
{ pkgs { pkgs }:
, config
, ... { ... }:
}:
let let
channelSources = (import ../../default.nix {
versionsPath = ../../variables/versions.nix;
}).channelSources;
just-plugin = just-plugin =
let let
plugin_file = pkgs.writeText "_just" '' plugin_file = pkgs.writeText "_just" ''
@ -71,7 +66,7 @@ in {
# don't cd into directories when executed # don't cd into directories when executed
unsetopt AUTO_CD unsetopt AUTO_CD
source ${channelSources} export NIX_PATH="${pkgs.nixPath}"
# print lines without termination # print lines without termination
setopt PROMPT_CR setopt PROMPT_CR

View file

@ -1,9 +1,12 @@
{ { pkgs
... , ...
}: }:
{ {
home-manager.users.steveej = import ../../../home-manager/configuration/graphical-fullblown.nix; nixpkgs.config.packageOverrides = pkgs: with pkgs; {
nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath;
};
home-manager.users.steveej = import ../../../home-manager/configuration/graphical-fullblown.nix { inherit pkgs; };
services.teamviewer.enable = true; services.teamviewer.enable = true;
system.stateVersion = "19.09"; system.stateVersion = "19.09";
} }

View file

@ -10,7 +10,7 @@
nixpkgsMaster = { nixpkgsMaster = {
url = "https://github.com/NixOS/nixpkgs/"; url = "https://github.com/NixOS/nixpkgs/";
ref = "master"; ref = "master";
rev = "e7add4afc1615e12474a79098b897e11686953b7"; rev = "c0e65c63401c9c75c403df207e4bd6439b965cb4";
}; };
homeManagerModule = { homeManagerModule = {
url = "https://github.com/rycee/home-manager"; url = "https://github.com/rycee/home-manager";

View file

@ -5,7 +5,10 @@
}: }:
{ {
home-manager.users.steveej = import ../../../home-manager/configuration/text-minimal.nix; nixpkgs.config.packageOverrides = pkgs: with pkgs; {
nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath;
};
home-manager.users.steveej = import ../../../home-manager/configuration/text-minimal.nix { inherit pkgs; };
services.hydra = { services.hydra = {
enable = false; enable = false;

View file

@ -6,7 +6,7 @@
imports = [ imports = [
"${<home-manager-module>}/nixos" "${<home-manager-module>}/nixos"
]; ];
home-manager.users.root = import ../../../home-manager/configuration/text-minimal.nix; home-manager.users.root = import ../../../home-manager/configuration/text-minimal.nix { inherit pkgs; };
nixpkgs.config = { nixpkgs.config = {
allowBroken = false; allowBroken = false;

View file

@ -29,6 +29,10 @@
} }
''; '';
environment.variables = {
NIX_PATH = lib.mkForce pkgs.nixPath;
};
# Fonts, I18N, Date ... # Fonts, I18N, Date ...
fonts.fonts = [ fonts.fonts = [
pkgs.corefonts pkgs.corefonts

View file

@ -1,7 +1,10 @@
{ { pkgs
... , ...
}: }:
{ {
home-manager.users.steveej = import ../../../home-manager/configuration/graphical-removable.nix; nixpkgs.config.packageOverrides = pkgs: with pkgs; {
nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath;
};
home-manager.users.steveej = import ../../../home-manager/configuration/graphical-removable.nix { inherit pkgs; };
} }