-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.nix
126 lines (114 loc) · 3.47 KB
/
release.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
let
nixpkgs = import ./lib/nixpkgs.nix;
_nixpkgs = import "${nixpkgs}" {
overlays = [
(import ./pkgs/overlay.nix)
];
};
load = configuration: (import "${nixpkgs}/nixos" {
inherit configuration;
});
_channels = _nixpkgs.pkgs.callPackage ./lib/channels.nix {};
cleanSource = (import ./lib/cleansource.nix _nixpkgs.lib).cleanSource;
trim = builtins.replaceStrings [ "\n" ] [ "" ];
pkgs = _nixpkgs.lib.recurseIntoAttrs (_nixpkgs.callPackage ./pkgs/all-packages.nix { });
osConfig = { de, useLibre ? false }:
let
seedConf = {
softwareAllowUnfree = !useLibre;
keys = {
services.xserver.desktopManager.${de}.enable = true;
solar.features.libre = useLibre;
};
};
extraConf = { ... }: {
services.xserver.desktopManager.${de}.enable = true;
environment.etc."conf-tool-seed.json".text = builtins.toJSON seedConf;
solar.features.libre = useLibre;
};
merge = confs: { ... }: {
imports = confs;
};
in
{
iso = (load (merge [ extraConf ./config/profiles/iso.nix ])).config.system.build.isoImage;
installerVm = (load (merge [ extraConf ./config/profiles/installer-vm.nix ])).vm;
vm = (load (merge [ extraConf ./config/profiles/vm.nix ])).vm;
};
in
rec {
inherit pkgs;
cinnamon = osConfig { de = "cinnamon"; };
lxde = osConfig { de = "lxde"; };
mate = osConfig { de = "mate"; };
xfce = osConfig { de = "xfce"; };
isoAll = _nixpkgs.stdenv.mkDerivation {
name = "solaros-iso";
version = "0.0.0";
dontUnpack = true;
installPhase = ''
mkdir $out
ln -sv ${cinnamon.iso} $out/cinnamon
ln -sv ${cinnamon.iso}/iso/* $out/cinnamon.iso
ln -sv ${mate.iso} $out/mate
ln -sv ${mate.iso}/iso/* $out/mate.iso
ln -sv ${xfce.iso} $out/xfce
ln -sv ${xfce.iso}/iso/* $out/xfce.iso
'';
};
channels = {
nixos =
let
ghSrc = builtins.fromJSON (builtins.readFile ./lib/nixpkgs.json);
src = import ./lib/nixpkgs.nix;
in
_channels.createChannel {
channelName = "nixos";
binaryCache = "cache.nixos.org";
postCmd = "ln -s . nixpkgs";
inherit ghSrc src;
};
nixos-hardware =
let
ghSrc = builtins.fromJSON (builtins.readFile ./lib/nixos-hardware.json);
src = import ./lib/nixos-hardware.nix;
in
_channels.createChannel {
channelName = "nixos-hardware";
binaryCache = "cache.nixos.org";
inherit ghSrc src;
};
nixpkgs =
let
ghSrc = builtins.fromJSON (builtins.readFile ./lib/nixpkgs.json);
src = import ./lib/nixpkgs.nix;
in
_channels.createChannel {
channelName = "nixpkgs";
binaryCache = "cache.nixos.org";
inherit ghSrc src;
};
solaros =
let
gitRevision = trim (builtins.readFile ./.ref);
src = cleanSource ./.;
in
_channels.createChannel {
channelName = "solaros";
binaryCache = "solar.cachix.org";
inherit gitRevision src;
};
solarpkg =
let
ghSrc = builtins.fromJSON (builtins.readFile ./lib/solarpkg.json);
src = import ./lib/solarpkg.nix;
in
_channels.createChannel {
channelName = "solarpkg";
binaryCache = "solar.cachix.org";
inherit ghSrc src;
};
};
allChannels = _channels.createMergedOutput (builtins.attrValues channels);
tests = import ./tests/tests.nix;
}