Merge pull request 'Rework of x-os module / core profile' (#115) from feature/integrate-core-profile-into-x-os-and-rename-x-os-to-core into main

Reviewed-on: https://git.b12f.io/pub-solar/os/pulls/115
Reviewed-by: Benjamin Bädorf <b12f@noreply.example.org>
This commit is contained in:
Benjamin Bädorf 2022-08-14 13:13:27 +00:00
commit e436443bd2
12 changed files with 117 additions and 94 deletions

View file

@ -120,9 +120,9 @@
users = digga.lib.rakeLeaves ./users;
};
suites = with profiles; rec {
base = [ core users.pub-solar users.root ];
base = [ users.pub-solar users.root ];
iso = base ++ [ base-user graphical pub-solar-iso ];
pubsolaros = [ core dram full-install base-user users.root ];
pubsolaros = [ dram full-install base-user users.root ];
anonymous = [ pubsolaros users.pub-solar ];
};
};

View file

@ -1,15 +1,15 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.pub-solar.x-os;
cfg = config.pub-solar.core;
in
{
options.pub-solar.x-os.iso-options.enable = mkOption {
options.pub-solar.core.iso-options.enable = mkOption {
type = types.bool;
default = false;
description = "Feature flag for iso builds";
};
options.pub-solar.x-os.disk-encryption-active = mkOption {
options.pub-solar.core.disk-encryption-active = mkOption {
type = types.bool;
default = true;
description = "Whether it should be assumed that there is a cryptroot device";

34
modules/core/default.nix Normal file
View file

@ -0,0 +1,34 @@
{ lib, ... }:
with lib;
let
psCfg = config.pub-solar;
cfg = config.pub-solar.core;
in
{
imports = [
./boot.nix
./fonts.nix
./i18n.nix
./modules.nix
./networking.nix
./nix.nix
./packages.nix
./services.nix
];
pub-solar.terminal-life.enable = true;
pub-solar.audio.enable = lib.mkIf (!cfg.lite) true;
pub-solar.crypto.enable = lib.mkIf (!cfg.lite) true;
pub-solar.devops.enable = lib.mkIf (!cfg.lite) true;
options.pub-solar.core = {
lite = mkOption {
description = ''
Enable a lite edition of core with less default modules and a reduced package set.
'';
default = false;
type = types.bool;
};
};
}

View file

@ -2,10 +2,10 @@
with lib;
let cfg = config.pub-solar.x-os;
let cfg = config.pub-solar.core;
in
{
options.pub-solar.x-os = {
options.pub-solar.core = {
binaryCaches = mkOption {
type = types.listOf types.str;
default = [ ];

75
modules/core/packages.nix Normal file
View file

@ -0,0 +1,75 @@
{ config, pkgs, lib, ... }:
with lib;
let
psCfg = config.pub-solar;
cfg = config.pub-solar.core;
in
{
environment = {
systemPackages = with pkgs; [
# Core unix utility packages
coreutils-full
dnsutils
inetutils
progress
pciutils
usbutils
wget
openssl
openssh
curl
htop
lsof
psmisc
file
# zippit
zip
unzip
# Modern modern utilities
p7zip
croc
jq
]
++ lib.optionals (!cfg.lite) [
mtr
gitFull
git-lfs
git-bug
xdg-utils
sysfsutils
renameutils
nfs-utils
moreutils
mailutils
keyutils
input-utils
elfutils
binutils
dateutils
diffutils
findutils
exfat
# Nix specific utilities
niv
manix
nix-index
nix-tree
nixpkgs-review
# Build broken, python2.7-PyJWT-2.0.1.drv' failed
#nixops
psos
nvd
# Fun
neofetch
];
};
}

View file

@ -1,7 +1,6 @@
{ config, pkgs, lib, ... }:
{
# For rage encryption, all hosts need a ssh key pair
services.openssh = {
enable = true;

View file

@ -1,10 +0,0 @@
{ ... }: {
imports = [
./boot.nix
./fonts.nix
./i18n.nix
./networking.nix
./nix.nix
./services.nix
];
}

View file

@ -1,75 +0,0 @@
{ self, config, lib, pkgs, inputs, ... }:
let inherit (lib) fileContents;
in
{
# Sets nrdxp.cachix.org binary cache which just speeds up some builds
imports = [ ../cachix ];
config = {
pub-solar.terminal-life.enable = true;
pub-solar.audio.enable = true;
pub-solar.crypto.enable = true;
pub-solar.devops.enable = true;
environment = {
systemPackages = with pkgs; [
# Core unix utility packages
coreutils-full
progress
dnsutils
inetutils
mtr
pciutils
usbutils
gitFull
git-lfs
git-bug
wget
openssl
openssh
curl
htop
lsof
psmisc
xdg-utils
sysfsutils
renameutils
nfs-utils
moreutils
mailutils
keyutils
input-utils
elfutils
binutils
dateutils
diffutils
findutils
exfat
file
# zippit
zip
unzip
# Modern modern utilities
p7zip
croc
jq
# Nix specific utilities
niv
manix
nix-index
nix-tree
nixpkgs-review
# Build broken, python2.7-PyJWT-2.0.1.drv' failed
#nixops
psos
nvd
# Fun
neofetch
];
};
};
}

View file

@ -6,6 +6,6 @@ in
config = {
pub-solar.graphical.wayland.software-renderer.enable = true;
pub-solar.sway.terminal = "foot";
pub-solar.x-os.iso-options.enable = true;
pub-solar.core.iso-options.enable = true;
};
}