restructure system configuration

This commit is contained in:
ooks-io 2024-01-15 22:12:53 +13:00
parent 8f58a79fe2
commit e65c6bc159
27 changed files with 143 additions and 44 deletions

View file

@ -36,6 +36,12 @@
url = "github:helix-editor/helix";
inputs.nixpkgs.follows = "nixpkgs";
};
nh = {
url = "github:viperML/nh";
inputs.nixpkgs.follows = "nixpkgs";
};
};
@ -64,7 +70,7 @@
nixosConfigurations = {
# T480s
ookst480s = lib.nixosSystem {
modules = [ ./hosts/ookst480s/ookst480s.nix ];
modules = [ ./hosts/ookst480s ];
specialArgs = { inherit inputs outputs; };
};
};

View file

@ -1,13 +0,0 @@
{ config, lib, pkgs, ... }:
{
hardware.bluetooth.enable = true;
# services.blueman.enable = true;
environment.systemPackages = with pkgs; [
galaxy-buds-client
live-buds-cli
bluetuith
];
}

View file

@ -26,7 +26,6 @@
networking = {
hostName = "ookst480s";
networkmanager.enable = true;
};

View file

@ -11,17 +11,6 @@
];
home-manager.extraSpecialArgs = { inherit inputs outputs; };
nixpkgs = {
overlays = builtins.attrValues outputs.overlays;
config = {
allowUnfree = true;
permittedInsecurePackages = [
"openssl-1.1.1u"
];
};
};
#hardware.enableRedistibutableFirmware = true;
environment.enableAllTerminfo = true;

View file

@ -6,4 +6,5 @@
];
};
time.timeZone = lib.mkDefault "Pacific/Auckland";
services.geoclue2.enable = true;
}

View file

@ -28,6 +28,7 @@
polkit = {
enable = true;
};
pam.services = { swaylock = { }; };
sudo = {
enable = true;
extraConfig = ''

View file

@ -0,0 +1,9 @@
{
imports = [
./hardware
./networking
./nix
./programs
./user
];
}

View file

@ -0,0 +1,14 @@
{
hardware.brillo.enable = true;
services.clight = {
enable = true;
settings = {
verbose = true;
backlight.disabled = true;
dpms.timeouts = [900 300];
dimmer.timeouts = [870 270];
gamma.long_transition = true;
screen.disabled = true;
};
};
}

View file

@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
{
hardware.bluetooth = {
enable = true;
package = pkgs.bluez5-experimental;
};
environment.systemPackages = with pkgs; [
galaxy-buds-client
live-buds-cli
bluetuith
];
# https://github.com/NixOS/nixpkgs/issues/114222
systemd.user.services.telephony_client.enable = false;
}

View file

@ -0,0 +1,18 @@
{ lib, ... }:
{
networking.networkmanager = {
enable = true;
dns = "systemd-resolved";
};
networking.firewall.allowedTCPPorts = [57621];
services = {
openssh = {
enable = true;
settings.UseDns = true;
};
resolved.enable = true;
};
systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
}

View file

@ -0,0 +1,8 @@
{
imports = [
./nh.nix
./nix.nix
./nixpkgs
./subs.nix
];
}

16
system/modules/nix/nh.nix Normal file
View file

@ -0,0 +1,16 @@
{ inputs, ... }: {
imports = [
inputs.nh.nixosModules.default
];
environment.variables.FLAKE = "/home/ooks/Coding/nix/ooks-io/nix";
nh = {
enable = true;
clean = {
enable = true;
extraArgs = "--keep-since 30d";
};
};
}

View file

@ -1,5 +1,5 @@
{ inputs, lib, ... }:
{
{ config, lib, pkgs, inputs, ... }: {
nix = {
settings = {
trusted-users = [ "root" "@wheel" ];
@ -9,18 +9,7 @@
system-features = [ "kvm" "big-parallel" "nixos-test" ];
flake-registry = "";
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 2d";
};
# Add each flake input as a registry
# To make nix3 commands consistent with the flake
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
# Add nixpkgs input to NIX_PATH
# This lets nix2 commands still use <nixpkgs>
nixPath = [ "nixpkgs=${inputs.nixpkgs.outPath}" ];
};
};
}

View file

@ -0,0 +1,13 @@
{ outputs, ... }: {
nixpkgs = {
overlays = builtins.attrValues outputs.overlays;
config = {
allowUnfree = true;
permittedInsecurePackages = [
"openssl-1.1.1u"
"electron-25.9.0"
];
};
};
}

View file

@ -0,0 +1,18 @@
{
nix.settings = {
substituters = [
"https://cache.nixos.org?priority=10"
"https://fufexan.cachix.org"
"https://helix.cachix.org"
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}

View file

@ -0,0 +1,18 @@
{ config, lib, ... }:
let
cfg = config.system.profile.laptop;
in
{
imports = [
../modules
];
config = cfg.enable {
system = {
hardware = {
bluetooth.enable = true;
powerSettings.enable = true
backlight.enable = true;
};
};
};
}

View file

@ -20,8 +20,4 @@ in
};
home-manager.users.ooks = import ../../../../home/user/ooks/${config.networking.hostName};
services.geoclue2.enable = true;
security.pam.services = { swaylock = { }; };
}