-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
161 lines (132 loc) · 5.76 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
{
description = "This is an 'nix flake' :)";
/*
nix \
flake \
lock \
--override-input nixpkgs github:NixOS/nixpkgs/ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b \
--override-input flake-utils github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a
nix \
flake \
lock \
--override-input nixpkgs 'github:NixOS/nixpkgs/ae2fc9e0e42caaf3f068c1bfdc11c71734125e06' \
--override-input flake-utils 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a'
nix \
flake \
lock \
--override-input nixpkgs 'github:NixOS/nixpkgs/057f63b6dc1a2c67301286152eb5af20747a9cb4' \
--override-input flake-utils 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a'
nix \
flake \
lock \
--override-input nixpkgs 'github:NixOS/nixpkgs/cdd2ef009676ac92b715ff26630164bb88fec4e0' \
--override-input flake-utils 'github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b'
*/
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
# nixpkgs-darwin-stable.url = "github:nixos/nixpkgs/nixpkgs-22.11-darwin";
# nixpkgs-linux-unstable.url = "nixpkgs/nixos-unstable";
# nixos-generators = {
# url = "github:nix-community/nixos-generators";
# inputs.nixpkgs.follows = "nixpkgs-linux-stable";
# };
};
outputs =
allAttrs@{ self
, nixpkgs
, flake-utils
,
}:
let
name = "es";
suportedSystems = [
"x86_64-linux"
"aarch64-linux"
# "aarch64-darwin"
];
in
flake-utils.lib.eachSystem suportedSystems
(suportedSystem:
let
pkgsAllowUnfree = import nixpkgs { system = suportedSystem; config = { allowUnfree = true; }; };
# https://gist.github.com/tpwrules/34db43e0e2e9d0b72d30534ad2cda66d#file-flake-nix-L28
pleaseKeepMyInputs = pkgsAllowUnfree.writeTextDir "bin/.please-keep-my-inputs"
(builtins.concatStringsSep " " (builtins.attrValues allAttrs));
in
{
devShells.default = pkgsAllowUnfree.mkShell {
buildInputs = with pkgsAllowUnfree; [
bashInteractive
coreutils
curl
gh
gnumake
nixpkgs-fmt # find . -type f -iname '*.nix' -exec nixpkgs-fmt {} \;
patchelf
poetry
python3Full
tmate
pleaseKeepMyInputs
];
shellHook = ''
echo -e 'Education' | "${pkgsAllowUnfree.figlet}/bin/figlet" | cat
echo -e ' and' | "${pkgsAllowUnfree.figlet}/bin/figlet" | cat
echo -e 'Science' | "${pkgsAllowUnfree.figlet}/bin/figlet" | cat
test -d .profiles || mkdir -v .profiles
test -L .profiles/dev \
|| nix develop .# --profile .profiles/dev --command true
test -L .profiles/dev-shell-default \
|| nix build $(nix eval --impure --raw .#devShells."$system".default.drvPath) --out-link .profiles/dev-shell-"$system"-default
'';
};
checks."${suportedSystem}" = self.packages."${suportedSystem}".hello;
packages.default = self.packages."${suportedSystem}".hello;
packages.hello = pkgsAllowUnfree.hello;
packages.hello-unfree = pkgsAllowUnfree.hello-unfree;
packages.python3WithPandas = pkgsAllowUnfree.python3Packages.pandas;
packages.installStartConfigTemplate = (import ./src/pkgs/install-start-config-template { pkgs = pkgsAllowUnfree; });
packages.installNixFlakesHomeManagerZshTemplate = (import ./src/pkgs/install-nix-flakes-home-manager-zsh-template { pkgs = pkgsAllowUnfree; });
packages.installQEMUVirtualMachineDockerTemplate = (import ./src/pkgs/install-qemu-virtual-machine-docker-template { pkgs = pkgsAllowUnfree; });
packages.installQEMUVirtualMachineXfceCopyPasteTemplate = (import ./src/pkgs/install-qemu-virtual-machine-xfce-copy-paste-template { pkgs = pkgsAllowUnfree; });
packages.installQEMUVirtualMachineXfceCopyPasteMinimalTemplate = (import ./src/pkgs/install-qemu-virtual-machine-xfce-copy-paste-minimal-template { pkgs = pkgsAllowUnfree; });
packages.sendToCacheInstallStartConfigTemplate = (import ./src/pkgs/send-to-cache-install-start-config-template { pkgs = pkgsAllowUnfree; });
formatter = pkgsAllowUnfree.nixpkgs-fmt;
apps = {
installStartConfigTemplate = flake-utils.lib.mkApp {
name = "install-start-config-template";
drv = self.packages."${suportedSystem}".installStartConfigTemplate;
};
installTemplateNixFlakesHomeManagerZsh = flake-utils.lib.mkApp {
name = "install-nix-flakes-home-manager-zsh-template";
drv = self.packages."${suportedSystem}".installNixFlakesHomeManagerZshTemplate;
};
installQEMUVirtualMachineDockerTemplate = flake-utils.lib.mkApp {
name = self.packages."${suportedSystem}".installQEMUVirtualMachineDockerTemplate.name;
drv = self.packages."${suportedSystem}".installQEMUVirtualMachineDockerTemplate;
};
installQEMUVirtualMachineXfceCopyPasteTemplate =
let
p = self.packages."${suportedSystem}".installQEMUVirtualMachineXfceCopyPasteTemplate;
in
flake-utils.lib.mkApp {
name = p.name;
drv = p;
};
installQEMUVirtualMachineXfceCopyPasteMinimalTemplate =
let
p = self.packages."${suportedSystem}".installQEMUVirtualMachineXfceCopyPasteMinimalTemplate;
in
flake-utils.lib.mkApp {
name = p.name;
drv = p;
};
};
}
)
//
{
templates = import ./src/templates;
}
;
}