mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-04 21:43:15 -06:00
library extensions
This commit is contained in:
parent
6e3aa008df
commit
280e475edc
12 changed files with 46 additions and 36 deletions
|
@ -8,10 +8,10 @@
|
|||
restic
|
||||
];
|
||||
|
||||
languages = {
|
||||
nim = true;
|
||||
python = true;
|
||||
};
|
||||
oizys.languages = [
|
||||
"nim"
|
||||
"python"
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
rclone
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{mkRune, ...}: {
|
||||
users.motd = mkRune {
|
||||
{lib, ...}: {
|
||||
users.motd = lib.mkRune {
|
||||
number = "6";
|
||||
rune = "algiz";
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
];
|
||||
|
||||
oizys.desktop.enable = true;
|
||||
cli.enable = true;
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
mkRune,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
users.motd = mkRune {
|
||||
users.motd = lib.mkRune {
|
||||
number = "2";
|
||||
rune = "mannaz";
|
||||
};
|
||||
|
|
|
@ -14,17 +14,15 @@
|
|||
desktop.enable = true;
|
||||
vpn.enable = true;
|
||||
languages = [
|
||||
"misc"
|
||||
"python"
|
||||
"nim"
|
||||
"tex"
|
||||
"node"
|
||||
];
|
||||
"misc"
|
||||
"python"
|
||||
"nim"
|
||||
"tex"
|
||||
"node"
|
||||
];
|
||||
};
|
||||
vivaldi.enable = true;
|
||||
|
||||
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
zk
|
||||
rclone
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
pkgs,
|
||||
mkRune,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
networking.networkmanager.enable = true;
|
||||
|
@ -27,7 +27,7 @@
|
|||
pamixer
|
||||
];
|
||||
|
||||
services.getty.greetingLine = mkRune {
|
||||
services.getty.greetingLine = lib.mkRune {
|
||||
rune = "othalan";
|
||||
runeKind = "ascii";
|
||||
};
|
||||
|
|
|
@ -7,11 +7,9 @@
|
|||
inherit (nixpkgs.lib) hasSuffix nixosSystem genAttrs;
|
||||
inherit (nixpkgs.lib.filesystem) listFilesRecursive;
|
||||
|
||||
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
|
||||
supportedSystems = ["x86_64-linux" ];
|
||||
runes = import ../modules/runes;
|
||||
in rec {
|
||||
forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system});
|
||||
lib = nixpkgs.lib.extend (final: prev: {
|
||||
mkIfIn = name: list: prev.mkIf (builtins.elem name list);
|
||||
mkRune = {
|
||||
rune,
|
||||
number ? "6",
|
||||
|
@ -19,6 +17,20 @@ in rec {
|
|||
}:
|
||||
"[1;3${number}m\n" + runes.${rune}.${runeKind} + "\n[0m";
|
||||
|
||||
|
||||
});
|
||||
|
||||
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
|
||||
supportedSystems = ["x86_64-linux"];
|
||||
in rec {
|
||||
forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system});
|
||||
# mkRune = {
|
||||
# rune,
|
||||
# number ? "6",
|
||||
# runeKind ? "braille",
|
||||
# }:
|
||||
# "[1;3${number}m\n" + runes.${rune}.${runeKind} + "\n[0m";
|
||||
|
||||
isNixFile = path: hasSuffix ".nix" path;
|
||||
buildOizys = _:
|
||||
forAllSystems (
|
||||
|
@ -42,7 +54,7 @@ in rec {
|
|||
isNixFile
|
||||
(listFilesRecursive (../. + "/hosts/${hostname}"));
|
||||
|
||||
specialArgs = {inherit inputs mkRune self;};
|
||||
specialArgs = {inherit inputs lib self;};
|
||||
};
|
||||
mapHosts = dir: mapAttrs (name: _: mkSystem name) (readDir dir);
|
||||
buildHosts = _: mapHosts ../hosts;
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIfIn;
|
||||
cfg = config.oizys.languages;
|
||||
in {
|
||||
config = mkIf (builtins.elem "misc" cfg) {
|
||||
config = mkIfIn "misc" cfg {
|
||||
environment.systemPackages = with pkgs; [
|
||||
go
|
||||
rustup
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIfIn;
|
||||
cfg = config.oizys.languages;
|
||||
in {
|
||||
config = mkIf (builtins.elem "nim" cfg) {
|
||||
config = mkIfIn "nim" cfg {
|
||||
environment.systemPackages = with pkgs; [
|
||||
nim
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIfIn;
|
||||
cfg = config.oizys.languages;
|
||||
in {
|
||||
config = mkIf (builtins.elem "node" cfg) {
|
||||
config = mkIfIn "node" cfg {
|
||||
environment.systemPackages = with pkgs; [
|
||||
nodejs
|
||||
nodePackages.pnpm
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
inherit (lib) mkIfIn;
|
||||
cfg = config.oizys.languages;
|
||||
in {
|
||||
config = mkIf (builtins.elem "python" cfg) {
|
||||
config = mkIfIn "python" cfg {
|
||||
environment.systemPackages = let
|
||||
python = pkgs.python3.withPackages (ps: with ps; [pip]);
|
||||
in
|
||||
|
|
|
@ -4,11 +4,10 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
# cfg = config.oizys.languages;
|
||||
langEnabled = name: builtins.elem name config.oizys.languages;
|
||||
inherit (lib) mkIf mkIfIn;
|
||||
cfg = config.oizys.languages;
|
||||
in {
|
||||
config = mkIf (langEnabled "tex") {
|
||||
config = mkIfIn "tex" cfg {
|
||||
environment.systemPackages = with pkgs; [
|
||||
texlive.combined.scheme-full
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue