Skip to content

Commit 8e61169

Browse files
committed
home.nix
1 parent d2784e3 commit 8e61169

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

.emacs.d/user.el

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
(setq flymake-start-syntax-check-on-newline nil)
9292
(setq flycheck-check-syntax-automatically '(save mode-enabled))
9393

94+
;; nix
95+
(use-package nix-mode
96+
:mode "\\.nix\\'")
97+
9498
;; keybinds
9599
(use-package evil
96100
:ensure t

.gitconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ ci="commit"
1010
br="branch"
1111
[core]
1212
autocrlf = input
13+
[pull]
14+
rebase = false

.shell/env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,9 @@ ns() {
4040
nix-shell -p $1 --run "$@"
4141
}
4242

43+
showdrv() {
44+
nix show-derivation "/nix/store/$1"
45+
}
46+
4347
# Export the user created function names. -- t. mvdw
4448
export BASH_FUNCTION_NAMES=$(declare -F | awk '{if (substr($3, 0, 1) != "_") print $3}')

configuration.nix

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
# your system. Help is available in the configuration.nix(5) man page
44
# and in the NixOS manual (accessible by running ‘nixos-help’).
55
{ config, pkgs, ... }:
6-
rec {
7-
8-
imports = [ ./home.nix ];
9-
6+
{
107

118
boot.tmpOnTmpfs = true;
129

@@ -71,7 +68,6 @@ rec {
7168
users.extraGroups.aigis.gid = 1001;
7269
users.extraUsers = {
7370
ngyj = {
74-
name = "ngyj";
7571
createHome = true;
7672
home = "/home/ngyj";
7773
description = "namigyj";
@@ -90,15 +86,6 @@ rec {
9086
};
9187
};
9288

93-
home-cfgs = [
94-
{ user = users.extraUsers.ngyj
95-
; files = [
96-
"./foo.test"
97-
{ src = "./foo.test"; dst = "./bar.test"; }
98-
];
99-
}
100-
];
101-
10289
nixpkgs.config = {
10390
pulseaudio = true;
10491
allowUnfree = true;

home.nix

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,33 @@ let fileOptions = with types; submodule {
3131
'';
3232
};
3333

34-
files = mkOption {
34+
copy = mkOption {
3535
default = [];
3636
type = listOf (either str fileOptions);
3737
description = ''
3838
files to be copied
3939
'';
4040
};
41+
flan = mkOption {
42+
default = [];
43+
type = listOf (either str fileOptions);
44+
description = ''
45+
files to be passed to flan
46+
'';
47+
};
4148
};
4249
});
4350
};
4451
};
4552

4653
config = let f = x: if isString x then {src=x; dst=x;} else x;
4754
scriptForEach = f: builtins.foldl' (acc: x: f x + acc) "";
48-
files = u: map f u.files;
55+
copies = u: map f u.copy;
4956
package = pkgs.stdenvNoCC.mkDerivation {
5057
name = "home-cfg";
5158
src = builtins.path {
5259
path = ./.;
53-
filter = (path: type: path != ./.git);
60+
filter = (path: type: !(hasSuffix "/.git" path) && !(hasSuffix ".nix" path));
5461
};
5562
installPhase =
5663
"mkdir -p $out\n"
@@ -60,7 +67,7 @@ let fileOptions = with types; submodule {
6067
+ scriptForEach
6168
(file:
6269
"cp -r ${file.src} $out/${usr.user.name}/${file.dst}\n")
63-
(files usr))
70+
(copies usr))
6471

6572
config.home-cfgs;
6673
};

0 commit comments

Comments
 (0)