nix: add channel configuration and rework update process
This commit is contained in:
parent
239c2c9c44
commit
dd4cd9aaf4
14 changed files with 137 additions and 51 deletions
|
@ -1,11 +1,9 @@
|
|||
{ pkgs
|
||||
, config,
|
||||
, config,
|
||||
... }:
|
||||
|
||||
let
|
||||
# gitpkgs = import /home/steveej/src/github/NixOS/nixpkgs {};
|
||||
unstablepkgs = import <nixos-unstable> {};
|
||||
|
||||
unstablepkgs = import <nixos-unstable> { config = config.nixpkgs.config; };
|
||||
in {
|
||||
imports = [
|
||||
../profiles/common.nix
|
||||
|
@ -27,7 +25,7 @@ in {
|
|||
};
|
||||
|
||||
packageOverrides = pkgs: with pkgs; {
|
||||
myPython36 = python36Full.withPackages (ps: with ps; [
|
||||
myPython36 = python36Full.withPackages (ps: with ps; [
|
||||
pylint pep8 yapf flake8
|
||||
# autopep8 (broken)
|
||||
# pylint (broken)
|
||||
|
@ -53,11 +51,15 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
# gitpkgs = import /home/steveej/src/github/NixOS/nixpkgs {};
|
||||
# unstablepkgs = import <nixos-unstable> { config = { allowUnfree = true; }; };
|
||||
|
||||
home.sessionVariables = {
|
||||
};
|
||||
|
||||
home.packages = []
|
||||
++ (with pkgs; [
|
||||
|
||||
home.packages =
|
||||
[] ++ (with pkgs; [
|
||||
# Authentication
|
||||
cacert
|
||||
fprintd
|
||||
|
@ -67,12 +69,10 @@ in {
|
|||
# Nix package related tools
|
||||
patchelf
|
||||
nix-index
|
||||
nox
|
||||
nix-prefetch-scripts
|
||||
|
||||
# Version Control Systems
|
||||
git-crypt
|
||||
unstablepkgs.pijul
|
||||
gitFull
|
||||
gitless
|
||||
mr
|
||||
|
@ -111,7 +111,7 @@ in {
|
|||
iftop
|
||||
iperf
|
||||
bind
|
||||
socat
|
||||
socat
|
||||
|
||||
# samba
|
||||
iptables
|
||||
|
@ -156,6 +156,6 @@ in {
|
|||
## Python
|
||||
myPython36
|
||||
|
||||
busyboxStatic
|
||||
]);
|
||||
busyboxStatic
|
||||
]);
|
||||
}
|
||||
|
|
35
nix/home-manager/configuration/root.nix
Normal file
35
nix/home-manager/configuration/root.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ pkgs
|
||||
, config,
|
||||
... }:
|
||||
|
||||
let
|
||||
# gitpkgs = import /home/steveej/src/github/NixOS/nixpkgs {};
|
||||
# unstablepkgs = import <nixos-unstable> {};
|
||||
|
||||
in {
|
||||
imports = [
|
||||
../profiles/common.nix
|
||||
../profiles/nix-channels.nix
|
||||
../programs/neovim.nix
|
||||
../programs/zsh.nix
|
||||
];
|
||||
|
||||
nixpkgs.config = {
|
||||
packageOverrides = pkgs: with pkgs; {
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
};
|
||||
|
||||
home.packages = []
|
||||
++ (with pkgs; [
|
||||
# Authentication
|
||||
mkpasswd
|
||||
|
||||
# Version Control Systems
|
||||
git-crypt
|
||||
gitFull
|
||||
mr
|
||||
]);
|
||||
}
|
|
@ -43,8 +43,6 @@ in {
|
|||
NIXPKGS_ALLOW_UNFREE = "1";
|
||||
# Don't create .pyc files.
|
||||
PYTHONDONTWRITEBYTECODE = "1";
|
||||
|
||||
HOMESHICK_DIR="${pkgs.homeshick}";
|
||||
};
|
||||
|
||||
programs.command-not-found.enable = true;
|
||||
|
|
34
nix/home-manager/profiles/nix-channels.nix
Normal file
34
nix/home-manager/profiles/nix-channels.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
in {
|
||||
home.file.".nix-channels".text = ''
|
||||
https://nixos.org/channels/nixos-18.09 nixos
|
||||
https://nixos.org/channels/nixos-unstable nixos-unstable
|
||||
'';
|
||||
|
||||
home.activation._removeExistingNixChannels = config.lib.dag.entryBefore ["checkLinkTargets"] ''
|
||||
$DRY_RUN_CMD ${pkgs.writeScript "activation-script" ''
|
||||
set -ex
|
||||
if test -f $HOME/.nix-channels; then
|
||||
echo Moving existing file away...
|
||||
touch $HOME/.nix-channels.dummy
|
||||
mv --backup=numbered $HOME/.nix-channels.dummy $HOME/.nix-channels
|
||||
rm $HOME/.nix-channels
|
||||
fi
|
||||
''};
|
||||
'';
|
||||
|
||||
nixpkgs.config = {
|
||||
|
||||
packageOverrides = pkgs: with pkgs; {
|
||||
homeshick = builtins.fetchGit {
|
||||
url = "https://github.com/andsens/homeshick.git";
|
||||
ref = "master";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -4,7 +4,14 @@
|
|||
}:
|
||||
|
||||
let
|
||||
bootstrapRepos = pkgs.writeScript "bootstrapRepos" ''
|
||||
|
||||
in {
|
||||
home.sessionVariables = {
|
||||
HOMESHICK_DIR="${pkgs.homeshick}";
|
||||
};
|
||||
|
||||
home.activation.bootstrapRepos = config.lib.dag.entryAfter ["writeBoundary"] ''
|
||||
$DRY_RUN_CMD ${pkgs.writeScript "activation-script" ''
|
||||
set -e
|
||||
echo home-manager path is ${config.home.path}
|
||||
echo home is $HOME
|
||||
|
@ -15,15 +22,7 @@ let
|
|||
# echo Updating homeshick
|
||||
# ln -sfT ${pkgs.homeshick} "$HOMESICK_REPOS"/.homeshick
|
||||
# mv -Tf "$HOMESICK_REPOS"/{.,}homeshick
|
||||
'';
|
||||
|
||||
in {
|
||||
home.sessionVariables = {
|
||||
HOMESHICK_DIR="${pkgs.homeshick}";
|
||||
};
|
||||
|
||||
home.activation.bootstrapRepos = config.lib.dag.entryAfter ["writeBoundary"] ''
|
||||
$DRY_RUN_CMD ${bootstrapRepos}
|
||||
''};
|
||||
'';
|
||||
|
||||
nixpkgs.config = {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
let
|
||||
in {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
|
@ -16,15 +16,18 @@ in {
|
|||
%_%F{%(!.red.green)}$(prompt_char)%f '
|
||||
RPROMPT=""
|
||||
|
||||
# Automatic rehash
|
||||
# Automatic rehash
|
||||
zstyle ':completion:*' rehash true
|
||||
|
||||
if [ -f $HOME/.shrc.d/sh_aliases ]; then
|
||||
. $HOME/.shrc.d/sh_aliases
|
||||
. $HOME/.shrc.d/sh_aliases
|
||||
fi
|
||||
|
||||
source ${pkgs.homeshick}/homeshick.sh
|
||||
fpath=(${pkgs.homeshick}/completions $fpath)
|
||||
${if builtins.hasAttr "homeshick" pkgs then ''
|
||||
source ${pkgs.homeshick}/homeshick.sh
|
||||
fpath=(${pkgs.homeshick}/completions $fpath)
|
||||
'' else ''
|
||||
''}
|
||||
|
||||
# Disable intercepting of ctrl-s and ctrl-q as flow control.
|
||||
stty stop ''' -ixoff -ixon
|
||||
|
|
|
@ -1,23 +1,25 @@
|
|||
{ pkgs ? import <nixpkgs> {}
|
||||
, dir
|
||||
, rebuildarg ? null
|
||||
, rebuildarg
|
||||
, moreargs ? ""
|
||||
}:
|
||||
|
||||
let
|
||||
diskId = (import ((builtins.getEnv "PWD")+"/${dir}/hw.nix") {}).hardware.encryptedDisk.diskId;
|
||||
GIT_ROOT=''''$(git rev-parse --show-toplevel)'';
|
||||
|
||||
in {
|
||||
rebuild = pkgs.writeScript "script" ''
|
||||
#!/usr/bin/env bash
|
||||
set -xe
|
||||
|
||||
pushd ${dir}
|
||||
pushd ${GIT_ROOT}/${dir}
|
||||
export NIXOS_CONFIG="$PWD"/configuration.nix
|
||||
export INSTALL_ROOT="/mnt/$ID-root"
|
||||
|
||||
[[ -e "''${NIXOS_CONFIG}" ]]
|
||||
|
||||
nixos-rebuild -I nixos-config=''${NIXOS_CONFIG} ${rebuildarg}
|
||||
nixos-rebuild -I nixos-config=''${NIXOS_CONFIG} ${rebuildarg} ${moreargs}
|
||||
if test -L result; then
|
||||
rm result
|
||||
fi
|
||||
|
@ -52,7 +54,7 @@ in {
|
|||
#!/usr/bin/env bash
|
||||
set -xe
|
||||
ID=${diskId}
|
||||
pushd ${dir}
|
||||
pushd ${GIT_ROOT}/${dir}
|
||||
export NIXOS_CONFIG="$PWD"/configuration.nix
|
||||
export INSTALL_ROOT="/mnt/$ID-root"
|
||||
|
||||
|
|
|
@ -3,11 +3,8 @@
|
|||
... }:
|
||||
|
||||
let
|
||||
gitpkgs = import /home/steveej/src/github/NixOS/nixpkgs {};
|
||||
unstablepkgs = import <nixos-unstable> {};
|
||||
|
||||
in
|
||||
{
|
||||
in {
|
||||
nixpkgs.config = {
|
||||
allowBroken = false;
|
||||
allowUnfree = true;
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "mmc-sandiskultra32gb"; # Define your hostname.
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "steveej-rmvbl-mmc-SL32G_0x259093f6"; # Define your hostname.
|
||||
}
|
|
@ -40,4 +40,10 @@
|
|||
usbutils
|
||||
pciutils
|
||||
];
|
||||
|
||||
imports = [
|
||||
"${builtins.fetchGit { url = "https://github.com/rycee/home-manager.git"; ref = "master"; }}/nixos"
|
||||
];
|
||||
|
||||
home-manager.users.root = import ../../../home-manager/configuration/root.nix;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue