Compare commits

...

1 Commits
main ... main

13 changed files with 149 additions and 528 deletions

View File

@ -1,121 +1,5 @@
{
"nodes": {
"agenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1673301561,
"narHash": "sha256-gRUWHbBAtMuPDJQXotoI8u6+3DGBIUZHkyQWpIv7WpM=",
"owner": "ryantm",
"repo": "agenix",
"rev": "42d371d861a227149dc9a7e03350c9ab8b8ddd68",
"type": "github"
},
"original": {
"owner": "ryantm",
"repo": "agenix",
"type": "github"
}
},
"emacs-overlay": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1674359560,
"narHash": "sha256-gobqd75ujP/zFH6kSZNB3bA3YS4NMXWpZgMo1RAFEdk=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "184ae9c371a6251564e0b07391f7e9aaf310f002",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "emacs-overlay",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1631561581,
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_4": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_5": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -221,67 +105,6 @@
"type": "github"
}
},
"jillo": {
"inputs": {
"mkNodePackage": "mkNodePackage",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1674248483,
"narHash": "sha256-2kjUS6LPN7bmxKsUrUwLwuzpF4IxxBweiO+8G1PKGKc=",
"ref": "refs/heads/main",
"rev": "a97f774ce46dcef5dd36b1f3fbf2711ceba24d6b",
"revCount": 29,
"type": "git",
"url": "file:///home/oatmealine/jillo"
},
"original": {
"type": "git",
"url": "file:///home/oatmealine/jillo"
}
},
"mkNodePackage": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs",
"npmlock2nix": "npmlock2nix",
"pnpm2nix": "pnpm2nix"
},
"locked": {
"lastModified": 1633790997,
"narHash": "sha256-1mk4EwNkWtTNpeRivZmJTzB+92g07maeFRVUMnnRh1U=",
"owner": "winston0410",
"repo": "mkNodePackage",
"rev": "a7eca5e027c8b260dca4ece7d8dd187f92420611",
"type": "github"
},
"original": {
"owner": "winston0410",
"repo": "mkNodePackage",
"type": "github"
}
},
"nix-minecraft": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1674352074,
"narHash": "sha256-IQxf+CCjuETu6psq6F9gxPBISf2RLwGL0MmlCgY1aX0=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "acfd27fd83e9c3d56e649b98aef17974f29e7830",
"type": "github"
},
"original": {
"owner": "Infinidoge",
"repo": "nix-minecraft",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1673803274,
@ -299,18 +122,17 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1633351077,
"narHash": "sha256-z38JG4Bb0GtM1aF1pANVdp1dniMP23Yb3HnRoJRy2uU=",
"owner": "nixos",
"lastModified": 1674211260,
"narHash": "sha256-xU6Rv9sgnwaWK7tgCPadV6HhI2Y/fl4lKxJoG2+m9qs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "14aef06d9b3ad1d07626bdbb16083b83f92dc6c1",
"rev": "5ed481943351e9fd354aeb557679624224de38d5",
"type": "github"
},
"original": {
"owner": "nixos",
"id": "nixpkgs",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
"type": "indirect"
}
},
"nixpkgs-unstable": {
@ -328,185 +150,15 @@
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1659153955,
"narHash": "sha256-BAdA1WBHi/TBSaeyDjsVIqe62r0w/5ZvsaglXivOLLM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1e5d0fbd82f0f1370c70026d255deda2d9c8a585",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1674211260,
"narHash": "sha256-xU6Rv9sgnwaWK7tgCPadV6HhI2Y/fl4lKxJoG2+m9qs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5ed481943351e9fd354aeb557679624224de38d5",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1655361562,
"narHash": "sha256-chPaIIhmdL6jdZWpf/K6yQCsuBNOYuMqbJsNpLfrdTE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0b59d075675dc28bf9ebab466033280096c8d4fe",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1659219666,
"narHash": "sha256-pzYr5fokQPHv7CmUXioOhhzDy/XyWOIXP4LZvv/T7Mk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7b9be38c7250b22d829ab6effdee90d5e40c6e5c",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1659102345,
"narHash": "sha256-Vbzlz254EMZvn28BhpN8JOi5EuKqnHZ3ujFYgFcSGvk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "11b60e4f80d87794a2a4a8a256391b37c59a1ea7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"npmlock2nix": {
"flake": false,
"locked": {
"lastModified": 1633729941,
"narHash": "sha256-v2YPcEWI1Wz8ErivorubgLcDT06H6YzFT7uhp1ymqnE=",
"owner": "winston0410",
"repo": "npmlock2nix",
"rev": "6ade47a330b6919defb45c0eb984a64234aa8468",
"type": "github"
},
"original": {
"owner": "winston0410",
"ref": "issue113",
"repo": "npmlock2nix",
"type": "github"
}
},
"pnpm2nix": {
"flake": false,
"locked": {
"lastModified": 1594396611,
"narHash": "sha256-UXOUQ+2A89/zaxYhTHiRrRBU5exbUWrg+FoJYMcNwuI=",
"owner": "nix-community",
"repo": "pnpm2nix",
"rev": "f67be0925a91b92f54d99dbdead7a06920b979ac",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "pnpm2nix",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
"emacs-overlay": "emacs-overlay",
"home-manager": "home-manager",
"hyprland": "hyprland",
"hyprpaper": "hyprpaper",
"hyprpicker": "hyprpicker",
"jillo": "jillo",
"nix-minecraft": "nix-minecraft",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"nixpkgs-unstable": "nixpkgs-unstable",
"vscode-server": "vscode-server",
"watch-party": "watch-party"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1659179790,
"narHash": "sha256-HhCjnO20QbJFJExExiwAslpx0YpB0qpovKejE+HpSQ4=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "cc3c93a28de41ac38b93cdf075a6776c6e42d2a1",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"vscode-server": {
"inputs": {
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1662442857,
"narHash": "sha256-e2ex4mO4q6UBoJvPSRdYBX1vIvpulqs6SNxvdSsL6uE=",
"owner": "msteen",
"repo": "nixos-vscode-server",
"rev": "c54b714db58ad05d064f394d6603751ee6bd04f6",
"type": "github"
},
"original": {
"owner": "msteen",
"repo": "nixos-vscode-server",
"type": "github"
}
},
"watch-party": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_5",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1657657296,
"narHash": "sha256-eJnE1a3EiVM2EFhJ7nQvkTyEZ6/fOWYsnb6GYOSfizg=",
"type": "git",
"url": "file:///home/oatmealine/watch-party"
},
"original": {
"type": "git",
"url": "file:///home/oatmealine/watch-party"
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
}
},
"wlroots": {

View File

@ -2,8 +2,6 @@
description = "Frosted Flakes";
inputs = {
# temporary gitea workaround
#nixpkgs.url = "nixpkgs/nixos-22.05";
nixpkgs.url = "nixpkgs/nixos-unstable";
# WARNING: Where possible, prefer the stable branch of nixpkgs as nixpkgs-unstable may have incompatable or vulnerable software.
@ -12,30 +10,11 @@
home-manager.url = "github:nix-community/home-manager/release-22.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# agenix - age-encrypted secrets
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware = {
url = "github:nixos/nixos-hardware";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-minecraft = {
url = "github:Infinidoge/nix-minecraft";
inputs.nixpkgs.follows = "nixpkgs";
};
jillo.url = "/home/oatmealine/jillo";
watch-party.url = "/home/oatmealine/watch-party";
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
@ -51,12 +30,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};
vscode-server.url = "github:msteen/nixos-vscode-server";
};
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, vscode-server, nix-minecraft, hyprland, hyprpaper, hyprpicker, ... }:
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, hyprland, hyprpaper, hyprpicker, ... }:
let
system = "x86_64-linux";
system = "aarch64-linux";
lib = import ./lib { inherit pkgs inputs; lib = nixpkgs.lib; };
inherit (lib._) mapModules mapModulesRec mkHost;
@ -67,7 +45,7 @@
overlays = overlays ++ (lib.attrValues self.overlays);
};
pkgs = mkPkgs nixpkgs [ self.overlay nix-minecraft.overlay ];
pkgs = mkPkgs nixpkgs [ self.overlay ];
in {
packages."${system}" = mapModules ./packages (p: pkgs.callPackage p {});
overlay = final: prev: {
@ -77,7 +55,6 @@
overlays = mapModules ./overlays import;
nixosModules = (mapModulesRec ./modules import) ++ [
hyprland.nixosModules.default
vscode-server.nixosModule
];
nixosConfigurations = mapModules ./hosts (host: mkHost host { inherit system; });
devShell."${system}" = import ./shell.nix { inherit pkgs; };

View File

@ -0,0 +1,51 @@
{ pkgs, inputs, lib, ... }:
{
imports = [
./hardware-configuration.nix
];
user = {
packages = with pkgs; [
git
curl
helix
];
};
users.groups.dotfiles = {};
normalUsers = {
aether = {
conf = {
packages = with pkgs; [ bat duf broot bottom ];
shell = pkgs.fish;
extraGroups = [ "wheel" /* "nix-users" */ "dotfiles" ];
initialHashedPassword = "!";
};
homeConf.home = {
sessionVariables = {
EDITOR = "hx";
# NIX_REMOTE = "daemon";
};
};
};
};
keyboard = {
locale = "en_US.UTF-8";
variant = "qwerty";
};
time.timeZone = "Europe/Dublin";
modules = {
shell.fish.enable = true;
security.isLocalMachine = true;
hyprland.enable = true;
dev.zig.enable = true;
};
}

View File

@ -0,0 +1,65 @@
{ config, lib, pkgs, inputs, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/profiles/qemu-guest.nix")
];
boot = {
initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
initrd.kernelModules = [ ];
# kernelPackages = pkgs.linuxPackages_hardened;
# kernelModules = [ "kvm-intel" ];
loader = {
systemd-boot = {
enable = true;
configurationLimit = 10;
};
efi.canTouchEfiVariables = true;
};
};
nix.settings.cores = 3;
nix.settings.max-jobs = 6;
# disabling this is what's considered a "Bad Idea"
# however it is required by packages/ghost.nix, which
# is borrowed from https://notes.abhinavsarkar.net/2022/ghost-on-nixos
#
# i don't know of a cleaner way to do this, and i
# don't want to deal with ghost any longer than i
# already have, so This Will Do
nix.settings.sandbox = false;
modules.hardware.fs = {
enable = true;
ssd.enable = true;
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/a4278811-e227-4dea-b7a2-5eaaab003679";
fsType = "f2fs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/688D-5046";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/a3611c1a-5d34-484d-9fda-e9af0806b13a"; }
];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}

View File

@ -1,24 +0,0 @@
{ options, lib, inputs, pkgs, config, ... }:
with builtins;
with lib;
with lib._;
let
inherit (inputs) agenix;
secretsDir = "${toString ../hosts}/${config.networking.hostName}/secrets";
secretsFile = "${secretsDir}/secrets.nix";
in {
imports = [ agenix.nixosModules.age ];
environment.systemPackages = [ agenix.defaultPackage.x86_64-linux ];
age = {
secrets = mkMerge (map (x: {"x".file = "${secretsDir}/${x}";}) (attrNames (import secretsFile)));
identityPaths = options.age.identityPaths.default ++ (foldr (l: r: l ++ r) [] (map (user:
let
d = "/home/${user}/.ssh";
fs = map (f: d + "/" + f)
(filter (f: (f != "known_hosts") && (f != "*.old"))
(attrNames (readDir d)));
in fs) (attrNames config.defaultUsers)));
};
}

View File

@ -5,6 +5,8 @@ with lib;
config = {
environment.systemPackages = with pkgs; [
valgrind
gcc
musl
# nix-linter
];
};

View File

@ -14,7 +14,9 @@ in {
config = mkIf cfg.enable {
user.packages = with pkgs; [
cargo
rustc
rust-analyzer
libiconv
glibc
];
environment.sessionVariables.RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";

View File

@ -15,6 +15,7 @@ in {
config = mkIf cfg.enable {
user.packages = with pkgs; [
zig
zls
];
};
}

View File

@ -1,4 +1,4 @@
{ config, pkgs, options, lib, ... }:
{ config, pkgs, options, lib, inputs, ... }:
with lib;
let
@ -29,8 +29,11 @@ in {
brightnessctl
gammastep
wdisplays
nwg-launchers
wezterm
];
home-manager.sharedModules = [ inputs.hyprland.homeManagerModules.default ];
home._.wayland.windowManager.hyprland = {
enable = true;
extraConfig = ''
@ -46,14 +49,12 @@ in {
}
general {
main_mod = SUPER
gaps_in = 4
gaps_out = 4
border_size = 2
col.active_border = rgba(f7cd23ff)
col.inactive_border = rbga(0f0f0fff)
col.active_border = 0xfff7cd23
col.inactive_border = 0xff0f0f0f
cursor_inactive_timeout = 5
damage_tracking = full
layout = dwindle
}
@ -70,8 +71,8 @@ in {
drop_shadow = true
shadow_range = 4
shadow_render_
col.shadow = rgba(0f0f0f33)
col.shadow_inactive = rgba(0f0f0f1e)
col.shadow = 0x330f0f0f
col.shadow_inactive = 0x1e0f0f0f
}
gestures {
@ -79,19 +80,19 @@ in {
}
animations {
enable = true
enabled = true
bezier = workspacesBezier, 0.1, 0.9, 0.1, 0.9
bezier = fadeBezier, 0, 0, 0.6, 1
animation = fade, 1, 8, fadeBezier
animation = windows, 1, 8, fadeBezier, popin 60%
animation = workspaces, 1, 4, workspacesbezier, slide
animation = workspaces, 1, 4, workspacesBezier, slide
}
$mainMod = SUPER
bind = $mainMod, enter, exec, alacritty
bind = $mainMod, enter, exec, wezterm
bind = $mainMod, C, killactive,
bind = $mainMod, P, exec, nwggrid

View File

@ -51,7 +51,11 @@ in {
security.sudo.enable = false;
security.doas = {
enable = true;
extraRules = if cfg.isLocalMachine then [{ users = builtins.attrNames config.defaultUsers; keepEnv = true; noPass = true; }] else [];
extraRules = if cfg.isLocalMachine then [{
users = builtins.attrNames config.normalUsers;
keepEnv = true;
noPass = true;
}] else [];
};
boot.kernel.sysctl = {

View File

@ -1,50 +0,0 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.modules.services.jillo;
in {
options.modules.services.jillo = {
enable = mkOption {
type = types.bool;
default = false;
};
package = mkOption {
type = types.package;
default = pkgs._.jillo;
};
dataDir = mkOption {
type = types.either [types.path types.str];
};
};
config = mkIf cfg.enable {
users.users.jillo = {
group = "jillo";
home = cfg.dataDir;
createHome = true;
isSystemUser = true;
shell = "${pkgs.bash}/bin/bash";
};
users.groups.jillo = {};
environment.systemPackages = [ pkgs.nodejs-18_x ];
systemd.services.jillo = {
description = "Jillo Discord bot";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "notify";
User = "jillo";
Group = "jillo";
WorkingDirectory = cfg.dataDir;
ExecStart = "${pkgs.nodejs-18_x}/bin/npm run start";
Restart = "on-failure";
};
};
};
}

View File

@ -1,22 +0,0 @@
{ config, pkgs, lib, options, inputs, ... }:
with lib;
let
cfg = config.modules.services.minecraft;
in {
options.modules.services.minecraft = {
enable = mkOption {
type = types.bool;
default = false;
};
servers = options.services.minecraft-servers.servers;
};
config = mkIf cfg.enable {
services.minecraft-servers = {
enable = true;
eula = true;
servers = cfg.servers;
};
};
}

View File

@ -1,38 +0,0 @@
{ config, lib, pkgs, options, inputs, ... }:
with lib;
let
cfg = config.modules.services.watch-party;
in {
options.modules.services.watch-party = {
enable = mkOption {
type = types.bool;
default = false;
};
domain = mkOption {
type = types.str;
default = "watch-party.oat.zone";
};
port = mkOption {
type = types.int;
default = 1984;
};
};
config = mkIf cfg.enable {
services = {
#watch-party = {
# enable = true;
# port = cfg.port;
#};
nginx.virtualHosts."${cfg.domain}" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString cfg.port}";
};
};
};
};
}