mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-12 14:33:15 -06:00
Compare commits
No commits in common. "79c7654486977b8e83b13284945b3bd5d2a686b8" and "8f8c5515033dfa72137134ff27cf0238d3dd6256" have entirely different histories.
79c7654486
...
8f8c551503
11 changed files with 107 additions and 107 deletions
|
@ -1,14 +1,17 @@
|
|||
{
|
||||
enabled,
|
||||
enableAttrs,
|
||||
pipeList,
|
||||
...
|
||||
}:
|
||||
{ enabled, ... }:
|
||||
{
|
||||
oizys = {
|
||||
languages = [
|
||||
"nim"
|
||||
"node" # for docker langservers
|
||||
"python"
|
||||
"nushell"
|
||||
];
|
||||
rune.motd = enabled;
|
||||
languages = "nim|node|python|nushell" |> pipeList;
|
||||
} // ("docker|backups|nix-ld" |> pipeList |> enableAttrs);
|
||||
docker = enabled;
|
||||
backups = enabled;
|
||||
nix-ld = enabled;
|
||||
};
|
||||
|
||||
services.restic.backups.gdrive = {
|
||||
# directories created by gitea and soft-serve aren't world readable
|
||||
|
@ -24,6 +27,15 @@
|
|||
];
|
||||
};
|
||||
|
||||
# git user handles the forgjo ssh authentication
|
||||
users.users.git.isNormalUser = true;
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
users.users = {
|
||||
daylin = {
|
||||
extraGroups = [ "docker" ];
|
||||
};
|
||||
|
||||
git = {
|
||||
isNormalUser = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
{ enabled, ... }:
|
||||
{
|
||||
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
services.resolved = enabled;
|
||||
|
||||
services.fail2ban = enabled // {
|
||||
services.fail2ban = {
|
||||
enable = true;
|
||||
maxretry = 5;
|
||||
bantime = "24h";
|
||||
};
|
||||
|
@ -27,9 +26,8 @@
|
|||
# users.mutableUsers = false;
|
||||
|
||||
# Use the GRUB 2 boot loader.
|
||||
boot.loader.grub = enabled // {
|
||||
device = "/dev/sda"; # or "nodev" for efi only
|
||||
};
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
|
||||
|
||||
# don't delete this you foo bar
|
||||
system.stateVersion = "23.11"; # Did you read the comment?
|
||||
|
|
|
@ -4,13 +4,14 @@
|
|||
desktop = enabled;
|
||||
nix-ld = enabled;
|
||||
rune.motd = enabled;
|
||||
docker = enabled;
|
||||
};
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver = enabled // {
|
||||
displayManager.startx = enabled;
|
||||
windowManager.qtile = enabled;
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.startx.enable = true;
|
||||
windowManager.qtile.enable = true;
|
||||
};
|
||||
|
||||
users.users.daylin.extraGroups = [ "docker" ];
|
||||
}
|
||||
|
|
|
@ -1,17 +1,39 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
enabled,
|
||||
enableAttrs,
|
||||
pipeList,
|
||||
...
|
||||
}:
|
||||
{ enabled, config, ... }:
|
||||
{
|
||||
oizys = {
|
||||
vpn = enabled;
|
||||
desktop = enabled;
|
||||
hyprland = enabled;
|
||||
chrome = enabled;
|
||||
docker = enabled;
|
||||
nix-ld = enabled // {
|
||||
overkill = enabled;
|
||||
};
|
||||
languages = "misc|nim|node|nushell|python|roc|tex|zig" |> pipeList;
|
||||
} // ("vpn|desktop|hyprland|chrome|docker|vbox|backups|hp-scanner|llm" |> pipeList |> enableAttrs);
|
||||
vbox = enabled;
|
||||
backups = enabled;
|
||||
hp-scanner = enabled;
|
||||
languages = [
|
||||
"misc"
|
||||
"nim"
|
||||
"node"
|
||||
"nushell"
|
||||
"python"
|
||||
"roc"
|
||||
"tex"
|
||||
"zig"
|
||||
];
|
||||
llm = enabled;
|
||||
};
|
||||
|
||||
services.restic.backups.gdrive = {
|
||||
user = "daylin";
|
||||
repository = "rclone:g:archives/othalan";
|
||||
passwordFile = "/home/daylin/.config/restic/othalan-pass";
|
||||
paths = [
|
||||
"/home/daylin/stuff/"
|
||||
"/home/daylin/dev/"
|
||||
];
|
||||
};
|
||||
|
||||
users.users.${config.oizys.user}.extraGroups = [ "audio" ];
|
||||
}
|
||||
|
|
|
@ -3,16 +3,6 @@ let
|
|||
notes-git = ''${pkgs.git}/bin/git -C /home/daylin/stuff/notes'';
|
||||
in
|
||||
{
|
||||
services.restic.backups.gdrive = {
|
||||
user = "daylin";
|
||||
repository = "rclone:g:archives/othalan";
|
||||
passwordFile = "/home/daylin/.config/restic/othalan-pass";
|
||||
paths = [
|
||||
"/home/daylin/stuff/"
|
||||
"/home/daylin/dev/"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services.notes-bot = {
|
||||
description = "auto commit changes to notes";
|
||||
serviceConfig = {
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
enabled,
|
||||
...
|
||||
}:
|
||||
{ pkgs, enabled, ... }:
|
||||
{
|
||||
networking.networkmanager = enabled;
|
||||
services.fwupd = enabled;
|
||||
|
@ -26,7 +21,7 @@
|
|||
support32Bit = true;
|
||||
};
|
||||
};
|
||||
users.users.${config.oizys.user}.extraGroups = [ "audio" ];
|
||||
|
||||
environment.systemPackages = with pkgs; [ pamixer ];
|
||||
|
||||
# catppuccin/tty move to "module"
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
inputs: final: prev:
|
||||
let
|
||||
inherit (builtins)
|
||||
listToAttrs
|
||||
substring
|
||||
filter
|
||||
replaceStrings
|
||||
;
|
||||
inherit (builtins) listToAttrs substring filter;
|
||||
inherit (final)
|
||||
concatStringsSep
|
||||
hasSuffix
|
||||
|
@ -13,7 +8,6 @@ let
|
|||
mkIf
|
||||
mkOption
|
||||
types
|
||||
splitString
|
||||
;
|
||||
inherit (final.filesystem) listFilesRecursive;
|
||||
in
|
||||
|
@ -26,9 +20,6 @@ let
|
|||
enable = false;
|
||||
};
|
||||
|
||||
# "opt1|opt2" |> pipeList -> ["opt1" "opt2"]
|
||||
pipeList = s: s |> replaceStrings [ "\n" ] [ "|" ] |> splitString "|" |> filter (s': s' != "");
|
||||
|
||||
# ["a" "b"] -> {a.enable = true; b.enable = true;}
|
||||
enableAttrs =
|
||||
attrs:
|
||||
|
@ -79,9 +70,11 @@ let
|
|||
isNixFile = p: p |> hasSuffix ".nix";
|
||||
isDefaultNixFile = p: p |> hasSuffix "default.nix";
|
||||
# filterNotDefaultNixFile = paths: filter (p: !(isDefaultNixFile p) && (isNixFile p)) paths;
|
||||
filterNotDefaultNixFile = paths: paths |> filter (p: !(isDefaultNixFile p) && (isNixFile p));
|
||||
filterNotDefaultNixFile = paths:
|
||||
paths |> filter (p: !(isDefaultNixFile p) && (isNixFile p));
|
||||
# listNixFilesRecursive = dir: filterNotDefaultNixFile (listFilesRecursive dir);
|
||||
listNixFilesRecursive = dir: dir |> listFilesRecursive |> filterNotDefaultNixFile;
|
||||
listNixFilesRecursive = dir:
|
||||
dir |> listFilesRecursive |> filterNotDefaultNixFile;
|
||||
|
||||
# defaultLinuxPackage = flake: flake.packages.x86_64-linux.default;
|
||||
# defaultPackageGeneric = system: flake: "${flake}.packages.${system}.default";
|
||||
|
@ -94,6 +87,9 @@ let
|
|||
pkg = pkgFromSystem system;
|
||||
};
|
||||
|
||||
functional = {
|
||||
filterF = list: f: builtins.filter f list;
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit
|
||||
|
@ -112,6 +108,6 @@ in
|
|||
pkgFromSystem
|
||||
overlayFrom
|
||||
flakeFromSystem
|
||||
pipeList
|
||||
functional
|
||||
;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ let
|
|||
enableAttrs
|
||||
isNixFile
|
||||
flakeFromSystem
|
||||
pipeList
|
||||
;
|
||||
inherit (lib.filesystem) listFilesRecursive;
|
||||
|
||||
|
@ -59,7 +58,6 @@ let
|
|||
inherit
|
||||
mkDefaultOizysModule
|
||||
mkOizysModule
|
||||
pipeList
|
||||
enableAttrs
|
||||
hostName
|
||||
flake
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
ld-library-path
|
||||
builder.pl
|
||||
profile
|
||||
system-path
|
||||
nixos-help
|
||||
nixos-install
|
||||
nixos-version
|
||||
nixos-manual-html
|
||||
nixos-rebuild
|
||||
nixos-configuration-reference-manpage
|
||||
nixos-generate-config
|
||||
nixos-enter
|
||||
nixos-container
|
||||
nixos-build-vms
|
||||
nixos-wsl-version
|
||||
nixos-wsl-welcome-message
|
||||
nixos-wsl-welcome
|
||||
restic-gdrive
|
||||
gitea
|
||||
lock
|
||||
code
|
|
@ -255,12 +255,6 @@ func splitDrv(drv string) (string, string) {
|
|||
return drvName, hash
|
||||
}
|
||||
|
||||
const tableTmpl = `# Building Derivations
|
||||
| derivation | hash |
|
||||
|---|---|
|
||||
%s
|
||||
`
|
||||
|
||||
func writeDervationsToStepSummary(drvs []string) {
|
||||
tableRows := make([]string, len(drvs))
|
||||
for i, drv := range drvs {
|
||||
|
@ -270,7 +264,16 @@ func writeDervationsToStepSummary(drvs []string) {
|
|||
name, hash,
|
||||
)
|
||||
}
|
||||
o.writeToGithubStepSummary(fmt.Sprintf(tableTmpl, strings.Join(tableRows, "\n")))
|
||||
|
||||
o.writeToGithubStepSummary(
|
||||
fmt.Sprintf(`# Building Derivations
|
||||
| derivation | hash |
|
||||
|---|---|
|
||||
%s
|
||||
`,
|
||||
strings.Join(tableRows, "\n"),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
func NixBuild(minimal bool, rest ...string) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package oizys
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
@ -13,21 +12,22 @@ import (
|
|||
"github.com/charmbracelet/log"
|
||||
)
|
||||
|
||||
//go:embed ignored.txt
|
||||
var ignoredList string
|
||||
var ignoredMap = stringToMap(ignoredList)
|
||||
|
||||
func stringToMap(s string) map[string]struct{} {
|
||||
return stringSliceToMap(strings.Split(s, "\n"))
|
||||
}
|
||||
|
||||
func stringSliceToMap(slice []string) map[string]struct{} {
|
||||
hashMap := make(map[string]struct{}, len(slice))
|
||||
for _, s := range slice {
|
||||
hashMap[s] = struct{}{}
|
||||
}
|
||||
return hashMap
|
||||
}
|
||||
var ignoredMap = stringSliceToMap(
|
||||
[]string{
|
||||
// nix
|
||||
"ld-library-path", "builder.pl", "profile", "system-path",
|
||||
// nixos
|
||||
"nixos-help",
|
||||
"nixos-install", "nixos-version",
|
||||
"nixos-manual-html", "nixos-rebuild",
|
||||
"nixos-configuration-reference-manpage",
|
||||
"nixos-generate-config", "nixos-enter",
|
||||
"nixos-container", "nixos-build-vms",
|
||||
"nixos-wsl-version", "nixos-wsl-welcome-message", "nixos-wsl-welcome",
|
||||
// trivial packages
|
||||
"restic-gdrive", "gitea", "lock", "code",
|
||||
},
|
||||
)
|
||||
|
||||
type Derivation struct {
|
||||
InputDrvs map[string]interface{}
|
||||
|
@ -72,7 +72,13 @@ func drvNotIgnored(drv string) bool {
|
|||
return !ok
|
||||
}
|
||||
|
||||
|
||||
func stringSliceToMap(slice []string) map[string]struct{} {
|
||||
hashMap := make(map[string]struct{}, len(slice))
|
||||
for _, s := range slice {
|
||||
hashMap[s] = struct{}{}
|
||||
}
|
||||
return hashMap
|
||||
}
|
||||
|
||||
func drvsToInputs(derivation map[string]Derivation) []string {
|
||||
var drvs []string
|
||||
|
|
Loading…
Reference in a new issue