nix: add channel configuration and rework update process

This commit is contained in:
steveej 2018-11-03 11:45:40 +01:00
parent 239c2c9c44
commit dd4cd9aaf4
14 changed files with 137 additions and 51 deletions

View file

@ -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
]);
}

View 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
]);
}

View file

@ -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;

View 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";
};
};
};
}

View file

@ -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 = {

View file

@ -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