mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-29 11:30:43 -06:00
Compare commits
1 commit
94dca60858
...
fa1253baa5
Author | SHA1 | Date | |
---|---|---|---|
|
fa1253baa5 |
26 changed files with 372 additions and 414 deletions
85
flake.lock
85
flake.lock
|
@ -68,11 +68,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1711035742,
|
||||
"narHash": "sha256-5vvhCSUGG9TA2G1eIRgokuYizhRnZu0ZbcU1MXfHsUE=",
|
||||
"lastModified": 1710257359,
|
||||
"narHash": "sha256-43re5pzE/cswFAgw92/ugsB3+d5ufDaCcLtl9ztKfBo=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprcursor",
|
||||
"rev": "6a92473237f430399a417e1c2da9d7fcd4970086",
|
||||
"rev": "1761f6cefd77f4fcd2039d930c88d6716ddc4974",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -94,11 +94,11 @@
|
|||
"xdph": "xdph"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1711232090,
|
||||
"narHash": "sha256-3psLgLXBg4F9UU93E+zmMqoMhcIX6e8HEphXCxlfUOY=",
|
||||
"lastModified": 1710634512,
|
||||
"narHash": "sha256-dqYzqSsGB9PhwxG2H3oVRpqAMWziVuQ7k+02ASku8T4=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "Hyprland",
|
||||
"rev": "c7fbea3368452c34c47a4a634e642de6cd4090cb",
|
||||
"rev": "0387528c56c4d9faf93946cbc9426973de6ef61b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -115,11 +115,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1711036118,
|
||||
"narHash": "sha256-BxWizZAc845ks9BjEXosRjfBv/NMr1WwoORBQuixfII=",
|
||||
"lastModified": 1710415616,
|
||||
"narHash": "sha256-1qVByzzCcKoCmP8ReUSAjKU5V9pfTLHQIM4WI1tvQ9E=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "contrib",
|
||||
"rev": "536f00c5895015da1e7aa85bbee9aa6dcd149e69",
|
||||
"rev": "75420d09f93346d9d23d5a1e26b42699f6b66cd6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -188,11 +188,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710960526,
|
||||
"narHash": "sha256-tt0UgVKWeLQ+tFzvqrm4uAZbzONwdGshpfiLHAQ1P2c=",
|
||||
"lastModified": 1709914708,
|
||||
"narHash": "sha256-bR4o3mynoTa1Wi4ZTjbnsZ6iqVcPGriXp56bZh5UFTk=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprlang",
|
||||
"rev": "a2f39421144d42541c057be235154ce21b76c0f6",
|
||||
"rev": "a685493fdbeec01ca8ccdf1f3655c044a8ce2fe2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -207,11 +207,11 @@
|
|||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710677371,
|
||||
"narHash": "sha256-yqjXunc+Zvqf6rcH7W9wMvhr18jMZhDvIdnretlfj78=",
|
||||
"lastModified": 1710184940,
|
||||
"narHash": "sha256-FzYm4td3FJfzOAuEkCXt3KdUgZuA072OAQXqIq+IAMo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "lib-aggregate",
|
||||
"rev": "f890211817b941d9ed9de48d62ba8553fa2c20f3",
|
||||
"rev": "45b75bf534592c0c1c881a1c447f7fdb37a87eaf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -270,11 +270,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710644923,
|
||||
"narHash": "sha256-0fjbN5GYYDKPyPay0l8gYoH+tFfNqPPwP5sxxBreeA4=",
|
||||
"lastModified": 1710120787,
|
||||
"narHash": "sha256-tlLuB73OCOKtU2j83bQzSYFyzjJo3rjpITZE5MoofG8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-index-database",
|
||||
"rev": "e25efda85e39fcdc845e371971ac4384989c4295",
|
||||
"rev": "e76ff2df6bfd2abe06abd8e7b9f217df941c1b07",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -285,11 +285,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1711200738,
|
||||
"narHash": "sha256-dkJmk/ET/tRV4007O6kU101UEg1svUwiyk/zEEX9Tdg=",
|
||||
"lastModified": 1710534455,
|
||||
"narHash": "sha256-huQT4Xs0y4EeFKn2BTBVYgEwJSv8SDlm82uWgMnCMmI=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "20bc93ca7b2158ebc99b8cef987a2173a81cde35",
|
||||
"rev": "9af9c1c87ed3e3ed271934cb896e0cdd33dae212",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -301,11 +301,11 @@
|
|||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1710636348,
|
||||
"narHash": "sha256-/kB+ZWSdkZjbZ0FTqm0u84sf2jFS+30ysaEajmBjtoY=",
|
||||
"lastModified": 1710031547,
|
||||
"narHash": "sha256-pkUg3hOKuGWMGF9WEMPPN/G4pqqdbNGJQ54yhyQYDVY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "fa827dda806c5aa98f454da4c567991ab8ce422c",
|
||||
"rev": "630ebdc047ca96d8126e16bb664c7730dc52f6e6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -324,11 +324,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1711218979,
|
||||
"narHash": "sha256-glCjdonAlkP5vwZpP8FYD1WCaGYALF5FYRv09XsWu5c=",
|
||||
"lastModified": 1710631003,
|
||||
"narHash": "sha256-6bOCj2BUwOYDO1Lq3DgwIfrdUiieKkm1fCHFQRkLK4Y=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs-wayland",
|
||||
"rev": "0d291a959d01bb5d2bd2e20689b78258fa842cca",
|
||||
"rev": "bce941770aa96005f08c7b60851037352bf76156",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -381,17 +381,16 @@
|
|||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-wayland": "nixpkgs-wayland",
|
||||
"pinix": "pinix",
|
||||
"stable": "stable",
|
||||
"tsm": "tsm"
|
||||
"stable": "stable"
|
||||
}
|
||||
},
|
||||
"stable": {
|
||||
"locked": {
|
||||
"lastModified": 1711124224,
|
||||
"narHash": "sha256-l0zlN/3CiodvWDtfBOVxeTwYSRz93muVbXWSpaMjXxM=",
|
||||
"lastModified": 1710420202,
|
||||
"narHash": "sha256-MvFKESbq4rUWuaf2RKPNYENaSZEw/jaCLo2gU6oREcM=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "56528ee42526794d413d6f244648aaee4a7b56c0",
|
||||
"rev": "878ef7d9721bee9f81f8a80819f9211ad1f993da",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -468,28 +467,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tsm": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"dir": "nix",
|
||||
"lastModified": 1710955312,
|
||||
"narHash": "sha256-7F88bRcAqU1NPo89pKhR/d6NKRn2JJ2FWcSLITjvzdU=",
|
||||
"owner": "daylinmorgan",
|
||||
"repo": "tsm",
|
||||
"rev": "090dda23ad4ab87a68323a9e1924bc6d8ce6e0a6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"dir": "nix",
|
||||
"owner": "daylinmorgan",
|
||||
"repo": "tsm",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"wlroots": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
10
flake.nix
10
flake.nix
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
description = "nix begat oizys";
|
||||
|
||||
outputs = inputs @ {self, ...}:
|
||||
(import ./lib {inherit self inputs;}).oizysFlake;
|
||||
(import ./lib {
|
||||
inherit inputs;
|
||||
inherit self;
|
||||
})
|
||||
.oizysFlake {};
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
stable.url = "github:nixos/nixpkgs/nixos-23.11";
|
||||
|
||||
tsm.url = "github:daylinmorgan/tsm?dir=nix";
|
||||
tsm.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
hyprland.url = "github:hyprwm/Hyprland/main";
|
||||
hyprland.inputs.nixpkgs.follows = "nixpkgs";
|
||||
hyprland-contrib.url = "github:hyprwm/contrib";
|
||||
|
|
|
@ -1,28 +1,22 @@
|
|||
{
|
||||
self,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
}: {
|
||||
imports = with self.nixosModules; [
|
||||
docker
|
||||
restic
|
||||
];
|
||||
|
||||
oizys = {
|
||||
languages = [
|
||||
"nim"
|
||||
"node" # for docker langservers
|
||||
"python"
|
||||
];
|
||||
|
||||
docker = enabled;
|
||||
backups = enabled;
|
||||
};
|
||||
oizys.languages = [
|
||||
"nim"
|
||||
"python"
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
(writeShellScriptBin "gitea" ''
|
||||
rclone
|
||||
|
||||
(pkgs.writeShellScriptBin "gitea" ''
|
||||
ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@"
|
||||
'')
|
||||
];
|
||||
|
|
|
@ -2,34 +2,32 @@
|
|||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
imports = [];
|
||||
|
||||
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
|
||||
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = [];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/70d6dad3-1778-43bf-8f87-76dd7f54c545";
|
||||
fsType = "ext4";
|
||||
device = "/dev/disk/by-uuid/eb6cbf1e-e4a7-4312-a1af-4f78ad9cf138";
|
||||
fsType = "btrfs";
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/a4e4cad9-1844-45dd-9bea-eb77bd71c37b";}
|
||||
];
|
||||
swapDevices = [];
|
||||
|
||||
# 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.enp1s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.ens3.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
virtualisation.hypervGuest.enable = true;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
{lib, ...}: {
|
||||
users.motd = lib.mkRune {
|
||||
number = "6";
|
||||
rune = "algiz";
|
||||
};
|
||||
|
||||
services.resolved = enabled;
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/var/lib/swapfile";
|
||||
size = 2 * 1024;
|
||||
}
|
||||
];
|
||||
|
||||
services.resolved.enable = true;
|
||||
|
||||
services.fail2ban = {
|
||||
enable = true;
|
||||
|
@ -21,22 +26,25 @@ in {
|
|||
# networking.nameservers = [ "8.8.8.8"];
|
||||
|
||||
# allow tcp connections for revsere proxy
|
||||
networking.firewall =
|
||||
enabled
|
||||
// {
|
||||
allowedTCPPorts = [80 443];
|
||||
};
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [80 443];
|
||||
};
|
||||
|
||||
services.openssh =
|
||||
enabled
|
||||
// {settings.PasswordAuthentication = false;};
|
||||
services.openssh.enable = true;
|
||||
services.openssh.settings.PasswordAuthentication = false;
|
||||
|
||||
# users.mutableUsers = false;
|
||||
users.mutableUsers = false;
|
||||
|
||||
# Use the GRUB 2 boot loader.
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
|
||||
boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only
|
||||
|
||||
# don't delete this you foo bar
|
||||
system.stateVersion = "23.11"; # Did you read the comment?
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "22.11"; # Did you read the comment?
|
||||
}
|
||||
|
|
|
@ -1,18 +1,9 @@
|
|||
{
|
||||
self,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
{self, ...}: {
|
||||
imports = with self.nixosModules; [
|
||||
nix-ld
|
||||
];
|
||||
|
||||
oizys = {
|
||||
desktop = enabled;
|
||||
nix-ld = enabled;
|
||||
};
|
||||
oizys.desktop.enable = true;
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver = {
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
}: {
|
||||
users.motd = lib.mkRune {
|
||||
number = "2";
|
||||
rune = "mannaz";
|
||||
|
@ -13,7 +11,7 @@ in {
|
|||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader = {
|
||||
systemd-boot = enabled;
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
|
@ -28,31 +26,27 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
hardware.opengl =
|
||||
enabled
|
||||
// {
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
extraPackages = with pkgs; [
|
||||
libGL
|
||||
];
|
||||
setLdLibraryPath = true;
|
||||
};
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
extraPackages = with pkgs; [
|
||||
libGL
|
||||
];
|
||||
setLdLibraryPath = true;
|
||||
};
|
||||
# Load nvidia driver for Xorg and Wayland
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
hardware.nvidia = {
|
||||
# Modesetting is required.
|
||||
modesetting = enabled;
|
||||
modesetting.enable = true;
|
||||
|
||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
||||
powerManagement =
|
||||
enabled
|
||||
// {
|
||||
# Fine-grained power management. Turns off GPU when not in use.
|
||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||
finegrained = false;
|
||||
};
|
||||
powerManagement.enable = false;
|
||||
# Fine-grained power management. Turns off GPU when not in use.
|
||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||
powerManagement.finegrained = false;
|
||||
|
||||
# Use the NVidia open source kernel module (not to be confused with the
|
||||
# independent third-party "nouveau" open source driver).
|
||||
|
@ -71,8 +65,8 @@ in {
|
|||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
programs.nix-ld = enabled;
|
||||
services.openssh = enabled;
|
||||
programs.nix-ld.enable = true;
|
||||
services.openssh.enable = true;
|
||||
|
||||
networking.hostName = "mannaz";
|
||||
# networking.wireless.enable = true;
|
||||
|
@ -86,6 +80,21 @@ in {
|
|||
time.timeZone = "America/Chicago";
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
# don't delete this you foo bar
|
||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||
#
|
||||
# Most users should NEVER change this value after the initial install, for any reason,
|
||||
# even if you've upgraded your system to a new NixOS release.
|
||||
#
|
||||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||
# so changing it will NOT upgrade your system.
|
||||
#
|
||||
# This value being lower than the current NixOS release does NOT mean your system is
|
||||
# out of date, out of support, or vulnerable.
|
||||
#
|
||||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||
# and migrated your data accordingly.
|
||||
#
|
||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
system.stateVersion = "23.11"; # Did you read the comment?
|
||||
}
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
}: {
|
||||
imports = with self.nixosModules; [
|
||||
nix-ld
|
||||
restic
|
||||
docker
|
||||
];
|
||||
|
||||
oizys = {
|
||||
desktop = enabled;
|
||||
hyprland = enabled;
|
||||
chrome = enabled;
|
||||
docker = enabled;
|
||||
nix-ld = enabled;
|
||||
vbox = enabled;
|
||||
vpn = enabled;
|
||||
backups = enabled;
|
||||
vbox.enable = true;
|
||||
desktop.enable = true;
|
||||
vpn.enable = true;
|
||||
languages = [
|
||||
"misc"
|
||||
"python"
|
||||
|
@ -22,12 +21,16 @@ in {
|
|||
"node"
|
||||
];
|
||||
};
|
||||
vivaldi.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
zk
|
||||
rclone
|
||||
quarto
|
||||
];
|
||||
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
services.restic.backups.gdrive = {
|
||||
user = "daylin";
|
||||
repository = "rclone:g:archives/othalan";
|
||||
|
|
|
@ -2,27 +2,26 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) enabled;
|
||||
in {
|
||||
networking.networkmanager = enabled;
|
||||
services.printing = enabled;
|
||||
services.fwupd = enabled;
|
||||
hardware.bluetooth = enabled // {powerOnBoot = true;};
|
||||
}: {
|
||||
networking.networkmanager.enable = true;
|
||||
services.printing.enable = true;
|
||||
services.fwupd.enable = true;
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.bluetooth.powerOnBoot = true;
|
||||
|
||||
# https://github.com/NixOS/nixos-hardware/blob/c478b3d56969006e015e55aaece4931f3600c1b2/lenovo/thinkpad/x1/9th-gen/default.nix
|
||||
# https://github.com/NixOS/nixos-hardware/blob/c478b3d56969006e015e55aaece4931f3600c1b2/common/pc/ssd/default.nix
|
||||
services.fstrim = enabled;
|
||||
services.fstrim.enable = true;
|
||||
|
||||
# rtkit is optional but recommended
|
||||
security.rtkit = enabled;
|
||||
services.pipewire =
|
||||
enabled
|
||||
// {
|
||||
audio = enabled;
|
||||
pulse = enabled;
|
||||
alsa = enabled // {support32Bit = true;};
|
||||
};
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
audio.enable = true;
|
||||
pulse.enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
pamixer
|
||||
|
@ -47,6 +46,21 @@ in {
|
|||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
# boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# don't delete this you foo bar
|
||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||
#
|
||||
# Most users should NEVER change this value after the initial install, for any reason,
|
||||
# even if you've upgraded your system to a new NixOS release.
|
||||
#
|
||||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||
# so changing it will NOT upgrade your system.
|
||||
#
|
||||
# This value being lower than the current NixOS release does NOT mean your system is
|
||||
# out of date, out of support, or vulnerable.
|
||||
#
|
||||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||
# and migrated your data accordingly.
|
||||
#
|
||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
system.stateVersion = "23.11"; # Did you read the comment?
|
||||
}
|
||||
|
|
|
@ -5,53 +5,68 @@
|
|||
inherit (inputs) nixpkgs;
|
||||
lib = nixpkgs.lib.extend (import ./extended.nix);
|
||||
|
||||
inherit (builtins) mapAttrs readDir filter listToAttrs;
|
||||
inherit (lib) nixosSystem genAttrs isNixFile mkDefaultOizysModule mkOizysModule;
|
||||
inherit (builtins) concatLists attrValues mapAttrs elemAt match readDir filter listToAttrs;
|
||||
inherit (lib) nixosSystem genAttrs isNixFile;
|
||||
inherit (lib.filesystem) listFilesRecursive;
|
||||
|
||||
inherit (import ./find-modules.nix {inherit lib;}) findModulesList;
|
||||
#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});
|
||||
|
||||
nixosModules = listToAttrs (findModulesList ../modules);
|
||||
buildOizys = _:
|
||||
forAllSystems (
|
||||
pkgs: let
|
||||
pkg = pkgs.callPackage ../oizys {};
|
||||
in {
|
||||
oizys = pkg;
|
||||
default = pkg;
|
||||
}
|
||||
);
|
||||
|
||||
mkSystem = hostname:
|
||||
nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules =
|
||||
[
|
||||
../modules/oizys.nix
|
||||
../modules/common.nix
|
||||
../overlays
|
||||
]
|
||||
++ filter
|
||||
isNixFile
|
||||
(listFilesRecursive (../. + "/hosts/${hostname}"));
|
||||
|
||||
specialArgs = {inherit inputs lib self mkDefaultOizysModule mkOizysModule;};
|
||||
specialArgs = {inherit inputs lib self;};
|
||||
};
|
||||
mapHosts = dir: mapAttrs (name: _: mkSystem name) (readDir dir);
|
||||
|
||||
oizysHosts = mapAttrs (name: _: mkSystem name) (readDir ../hosts);
|
||||
oizysPkg = forAllSystems (
|
||||
pkgs: rec {
|
||||
oizys = pkgs.callPackage ../oizys {};
|
||||
default = oizys;
|
||||
}
|
||||
);
|
||||
devShells = forAllSystems (
|
||||
pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [git deadnix];
|
||||
};
|
||||
}
|
||||
);
|
||||
findModules = _: listToAttrs (findModulesList ../modules);
|
||||
# https://github.com/balsoft/nixos-config/blob/73cc2c3a8bb62a9c3980a16ae70b2e97af6e1abd/flake.nix#L109-L120
|
||||
findModulesList = dir:
|
||||
concatLists (attrValues (mapAttrs
|
||||
(name: type:
|
||||
if type == "regular"
|
||||
then [
|
||||
{
|
||||
name = elemAt (match "(.*)\\.nix" name) 0;
|
||||
value = dir + "/${name}";
|
||||
}
|
||||
]
|
||||
else if
|
||||
(readDir (dir + "/${name}"))
|
||||
? "default.nix"
|
||||
then [
|
||||
{
|
||||
inherit name;
|
||||
value = dir + "/${name}";
|
||||
}
|
||||
]
|
||||
else findModulesList (dir + "/${name}")) (readDir dir)));
|
||||
|
||||
oizysFlake = {
|
||||
nixosModules = nixosModules;
|
||||
nixosConfigurations = oizysHosts;
|
||||
packages = oizysPkg;
|
||||
devShells = devShells;
|
||||
oizysFlake = _: {
|
||||
nixosModules = findModules {};
|
||||
nixosConfigurations = mapHosts ../hosts;
|
||||
packages = buildOizys {};
|
||||
formatter = forAllSystems (pkgs: pkgs.alejandra);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,25 +1,7 @@
|
|||
final: prev: let
|
||||
inherit (final) hasSuffix mkEnableOption mkIf mkOption types;
|
||||
inherit (final) hasSuffix;
|
||||
runes = import ../modules/runes;
|
||||
in rec {
|
||||
enabled = {enable = true;};
|
||||
disabled = {enable = false;};
|
||||
|
||||
# ["a" "b"] -> {a.enable = true; b.enable = true;}
|
||||
enableAttrs = attrs:
|
||||
builtins.listToAttrs (map (attr: {
|
||||
name = attr;
|
||||
value = enabled;
|
||||
})
|
||||
attrs);
|
||||
# ["a" "b"] -> {a.enable = false; b.enable = false;}
|
||||
disableAttrs = attrs:
|
||||
builtins.listToAttrs (map (attr: {
|
||||
name = attr;
|
||||
value = disabled;
|
||||
})
|
||||
attrs);
|
||||
|
||||
in {
|
||||
isNixFile = path: hasSuffix ".nix" path;
|
||||
mkIfIn = name: list: prev.mkIf (builtins.elem name list);
|
||||
mkRune = {
|
||||
|
@ -28,17 +10,4 @@ in rec {
|
|||
runeKind ? "braille",
|
||||
}:
|
||||
"[1;3${number}m\n" + runes.${rune}.${runeKind} + "\n[0m";
|
||||
|
||||
mkOizysModule = config: attr: content: {
|
||||
options.oizys.${attr}.enable = mkEnableOption "enable ${attr} support";
|
||||
config = mkIf config.oizys.${attr}.enable content;
|
||||
};
|
||||
mkDefaultOizysModule = config: attr: content: {
|
||||
options.oizys.${attr}.enable = mkOption {
|
||||
default = true;
|
||||
description = "enable ${attr} support";
|
||||
type = types.bool;
|
||||
};
|
||||
config = mkIf config.oizys.${attr}.enable content;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
{...}: let
|
||||
inherit (builtins) concatLists attrValues mapAttrs elemAt match readDir;
|
||||
in rec {
|
||||
# https://github.com/balsoft/nixos-config/blob/73cc2c3a8bb62a9c3980a16ae70b2e97af6e1abd/flake.nix#L109-L120
|
||||
findModulesList = dir:
|
||||
concatLists (attrValues (mapAttrs
|
||||
(name: type:
|
||||
if type == "regular"
|
||||
then [
|
||||
{
|
||||
name = elemAt (match "(.*)\\.nix" name) 0;
|
||||
value = dir + "/${name}";
|
||||
}
|
||||
]
|
||||
else if
|
||||
(readDir (dir + "/${name}"))
|
||||
? "default.nix"
|
||||
then [
|
||||
{
|
||||
inherit name;
|
||||
value = dir + "/${name}";
|
||||
}
|
||||
]
|
||||
else findModulesList (dir + "/${name}")) (readDir dir)));
|
||||
}
|
|
@ -2,9 +2,7 @@
|
|||
lib,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption;
|
||||
in {
|
||||
}: {
|
||||
imports = with self.nixosModules; [
|
||||
users
|
||||
nix
|
||||
|
@ -14,25 +12,23 @@ in {
|
|||
vpn
|
||||
gpg
|
||||
|
||||
# gui
|
||||
fonts
|
||||
|
||||
lock
|
||||
qtile
|
||||
hyprland
|
||||
|
||||
virtualbox
|
||||
docker
|
||||
|
||||
gui
|
||||
fonts
|
||||
|
||||
languages
|
||||
|
||||
# programs
|
||||
chrome
|
||||
vivaldi
|
||||
vscode
|
||||
|
||||
nix-ld
|
||||
restic
|
||||
];
|
||||
|
||||
options.oizys.desktop.enable = mkEnableOption "is desktop";
|
||||
options.oizys.desktop.enable = lib.mkEnableOption "is desktop";
|
||||
}
|
|
@ -5,8 +5,9 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.oizys.desktop;
|
||||
in {
|
||||
config = mkIf config.oizys.desktop.enable {
|
||||
config = mkIf cfg.enable {
|
||||
fonts.fontconfig.enable = true;
|
||||
fonts.packages = with pkgs; [
|
||||
(nerdfonts.override {fonts = ["FiraCode"];})
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.oizys.desktop;
|
||||
in {
|
||||
config = mkIf config.oizys.desktop.enable {
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
wezterm
|
||||
alacritty
|
||||
|
|
|
@ -2,9 +2,12 @@
|
|||
inputs,
|
||||
pkgs,
|
||||
config,
|
||||
mkOizysModule,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.programs.hyprland;
|
||||
|
||||
lock = pkgs.writeShellApplication {
|
||||
name = "lock";
|
||||
runtimeInputs = with pkgs; [swaylock];
|
||||
|
@ -12,10 +15,10 @@
|
|||
swaylock -c 1e1e2e
|
||||
'';
|
||||
};
|
||||
in
|
||||
mkOizysModule config "hyprland" {
|
||||
programs.hyprland.enable = true;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
security.pam.services.swaylock = {};
|
||||
# programs.hyprland.package = inputs.hyprland.packages.${pkgs.system}.default;
|
||||
# Optional, hint electron apps to use wayland:
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
|
@ -49,4 +52,5 @@ in
|
|||
inputs.nixpkgs-wayland.overlay
|
||||
inputs.hyprland.overlays.default
|
||||
];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,29 +1,37 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
config,
|
||||
mkDefaultOizysModule,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
mkDefaultOizysModule config "cli" {
|
||||
programs.direnv.enable = true;
|
||||
environment.sessionVariables = {
|
||||
DIRENV_LOG_FORMAT = "[2mdirenv: %s[0m";
|
||||
}: let
|
||||
inherit (lib) mkOption mkIf types;
|
||||
cfg = config.oizys.cli;
|
||||
in {
|
||||
options.oizys.cli.enable = mkOption {
|
||||
default = true;
|
||||
description = "Whether to enable cli.";
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
chezmoi
|
||||
zoxide
|
||||
lsd
|
||||
fzf
|
||||
config = mkIf cfg.enable {
|
||||
programs.direnv.enable = true;
|
||||
environment.sessionVariables = {
|
||||
DIRENV_LOG_FORMAT = "[2mdirenv: %s[0m";
|
||||
};
|
||||
|
||||
# utils
|
||||
fd
|
||||
bat
|
||||
delta
|
||||
ripgrep
|
||||
environment.systemPackages = with pkgs; [
|
||||
chezmoi
|
||||
zoxide
|
||||
lsd
|
||||
fzf
|
||||
|
||||
btop
|
||||
inputs.tsm.packages.${pkgs.system}.tsm
|
||||
];
|
||||
# utils
|
||||
fd
|
||||
bat
|
||||
delta
|
||||
ripgrep
|
||||
|
||||
btop
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.oizys.desktop;
|
||||
in {
|
||||
config = mkIf config.oizys.desktop.enable {
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
# vscode
|
||||
vscode-fhs
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
{lib, ...}: let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkOption types literalExpression mdDoc;
|
||||
in {
|
||||
imports = [./nim.nix ./tex.nix ./misc.nix ./node.nix ./python.nix];
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
mkOizysModule,
|
||||
...
|
||||
}:
|
||||
mkOizysModule config "vpn" {
|
||||
environment.systemPackages = [pkgs.openconnect];
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
cfg = config.oizys.vpn;
|
||||
in {
|
||||
options.oizys.vpn.enable = mkEnableOption ''
|
||||
Whether to enable openconnect for vpn connection.
|
||||
'';
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [pkgs.openconnect];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,70 +1,59 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
cfg = config.oizys.nix-ld;
|
||||
in {
|
||||
options.oizys.nix-ld.enable = mkEnableOption "enable nix-ld support";
|
||||
config = mkIf cfg.enable {
|
||||
programs.nix-ld.enable = true;
|
||||
{pkgs, ...}: {
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
# Packages that need at least something in this list:
|
||||
# Geneious Prime
|
||||
# https://github.com/Mic92/dotfiles/blob/cb180bdd3805b373e556a93ccb275b7f0f902a3b/nixos/modules/nix-ld.nix#L9C3-L60C5
|
||||
programs.nix-ld.libraries = with pkgs; [
|
||||
alsa-lib
|
||||
at-spi2-atk
|
||||
at-spi2-core
|
||||
atk
|
||||
cairo
|
||||
cups
|
||||
curl
|
||||
dbus
|
||||
expat
|
||||
fontconfig
|
||||
freetype
|
||||
fuse3
|
||||
gdk-pixbuf
|
||||
glib
|
||||
gtk3
|
||||
icu
|
||||
libGL
|
||||
libappindicator-gtk3
|
||||
libdrm
|
||||
libglvnd
|
||||
libnotify
|
||||
libpulseaudio
|
||||
libunwind
|
||||
libusb1
|
||||
libuuid
|
||||
libxkbcommon
|
||||
mesa
|
||||
nspr
|
||||
nss
|
||||
openssl
|
||||
pango
|
||||
pipewire
|
||||
stdenv.cc.cc
|
||||
systemd
|
||||
vulkan-loader
|
||||
xorg.libX11
|
||||
xorg.libXScrnSaver
|
||||
xorg.libXcomposite
|
||||
xorg.libXcursor
|
||||
xorg.libXdamage
|
||||
xorg.libXext
|
||||
xorg.libXfixes
|
||||
xorg.libXi
|
||||
xorg.libXrandr
|
||||
xorg.libXrender
|
||||
xorg.libXtst
|
||||
xorg.libxcb
|
||||
xorg.libxkbfile
|
||||
xorg.libxshmfence
|
||||
zlib
|
||||
];
|
||||
};
|
||||
# Packages that need at least something in this list:
|
||||
# Geneious Prime
|
||||
# https://github.com/Mic92/dotfiles/blob/cb180bdd3805b373e556a93ccb275b7f0f902a3b/nixos/modules/nix-ld.nix#L9C3-L60C5
|
||||
programs.nix-ld.libraries = with pkgs; [
|
||||
alsa-lib
|
||||
at-spi2-atk
|
||||
at-spi2-core
|
||||
atk
|
||||
cairo
|
||||
cups
|
||||
curl
|
||||
dbus
|
||||
expat
|
||||
fontconfig
|
||||
freetype
|
||||
fuse3
|
||||
gdk-pixbuf
|
||||
glib
|
||||
gtk3
|
||||
icu
|
||||
libGL
|
||||
libappindicator-gtk3
|
||||
libdrm
|
||||
libglvnd
|
||||
libnotify
|
||||
libpulseaudio
|
||||
libunwind
|
||||
libusb1
|
||||
libuuid
|
||||
libxkbcommon
|
||||
mesa
|
||||
nspr
|
||||
nss
|
||||
openssl
|
||||
pango
|
||||
pipewire
|
||||
stdenv.cc.cc
|
||||
systemd
|
||||
vulkan-loader
|
||||
xorg.libX11
|
||||
xorg.libXScrnSaver
|
||||
xorg.libXcomposite
|
||||
xorg.libXcursor
|
||||
xorg.libXdamage
|
||||
xorg.libXext
|
||||
xorg.libXfixes
|
||||
xorg.libXi
|
||||
xorg.libXrandr
|
||||
xorg.libXrender
|
||||
xorg.libXtst
|
||||
xorg.libxcb
|
||||
xorg.libxkbfile
|
||||
xorg.libxshmfence
|
||||
zlib
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
mkOizysModule,
|
||||
...
|
||||
}:
|
||||
mkOizysModule config "chrome" {
|
||||
programs.chromium = {
|
||||
enable = true;
|
||||
|
||||
extensions = [
|
||||
"nngceckbapebfimnlniiiahkandclblb" # bitwarden
|
||||
"gfbliohnnapiefjpjlpjnehglfpaknnc" # surfingkeys
|
||||
"pbmlfaiicoikhdbjagjbglnbfcbcojpj" # simplify gmail
|
||||
"oemmndcbldboiebfnladdacbdfmadadm" # pdf viewer
|
||||
"clngdbkpkpeebahjckkjfobafhncgmne" # stylus
|
||||
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin
|
||||
];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
(google-chrome.override {
|
||||
commandLineArgs = [
|
||||
"--force-dark-mode"
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
33
modules/programs/vivaldi.nix
Normal file
33
modules/programs/vivaldi.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.vivaldi;
|
||||
in {
|
||||
options.vivaldi.enable = mkEnableOption "enable vivaldi + extensions";
|
||||
config = mkIf cfg.enable {
|
||||
programs.chromium = {
|
||||
enable = true;
|
||||
|
||||
extensions = [
|
||||
"nngceckbapebfimnlniiiahkandclblb" # bitwarden
|
||||
"gfbliohnnapiefjpjlpjnehglfpaknnc" # surfingkeys
|
||||
"pbmlfaiicoikhdbjagjbglnbfcbcojpj" # simplify gmail
|
||||
"oemmndcbldboiebfnladdacbdfmadadm" # pdf viewer
|
||||
"clngdbkpkpeebahjckkjfobafhncgmne" # stylus
|
||||
];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
(vivaldi.override {
|
||||
commandLineArgs = [
|
||||
"--force-dark-mode"
|
||||
];
|
||||
proprietaryCodecs = true;
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,16 +1,5 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
mkOizysModule,
|
||||
...
|
||||
}:
|
||||
mkOizysModule config "backups" {
|
||||
environment.systemPackages = with pkgs; [rclone];
|
||||
|
||||
{...}: {
|
||||
services.restic.backups.gdrive = {
|
||||
# BUG: if .conda/environments.txt doesn't exist then this won't work
|
||||
# workaround for now `mkdir ~/.conda && touch ~/.conda/environments.txt`
|
||||
|
||||
extraBackupArgs = [
|
||||
"--exclude-file /home/daylin/.config/restic/excludes.txt"
|
||||
"--exclude-file /home/daylin/.conda/environments.txt"
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
mkOizysModule,
|
||||
...
|
||||
}:
|
||||
mkOizysModule config "docker" {
|
||||
{pkgs, ...}: {
|
||||
virtualisation.docker.enable = true;
|
||||
environment.systemPackages = with pkgs; [
|
||||
lazydocker
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
{
|
||||
config,
|
||||
mkOizysModule,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
mkOizysModule config "vbox" {
|
||||
virtualisation.virtualbox = {
|
||||
host.enable = true;
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
cfg = config.oizys.vbox;
|
||||
in {
|
||||
options.oizys.vbox.enable = mkEnableOption "enable virtualbox host";
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.virtualbox = {
|
||||
host.enable = true;
|
||||
};
|
||||
users.extraGroups.vboxusers.members = ["daylin"];
|
||||
};
|
||||
users.extraGroups.vboxusers.members = ["daylin"];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue