Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
elythh committed Aug 29, 2024
1 parent e3d0f27 commit 0580d48
Show file tree
Hide file tree
Showing 7 changed files with 272 additions and 13 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
title = "flake";
};

namespace = "elythnix";
namespace = "elyth";
};
};
in
Expand All @@ -34,7 +34,7 @@
systems = {
modules = {
nixos = with inputs; [
hm.nixosModule
home-manager.nixosModule
nixos-hardware.nixosModules.lenovo-thinkpad-p14s-amd-gen2
grub2-themes.nixosModules.default
sops-nix.nixosModules.sops
Expand Down Expand Up @@ -74,8 +74,8 @@
grub2-themes.inputs.nixpkgs.follows = "nixpkgs";

# Home-manager
hm.url = "github:nix-community/home-manager";
hm.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";

# secret management
sops-nix.url = "github:Mic92/sops-nix";
Expand Down
114 changes: 114 additions & 0 deletions homes/x86_64-linux/gwen@grovetender/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
config,
lib,
namespace,
...
}:
let
inherit (lib.${namespace}) enabled;
in
{
elyth = {
user = {
enable = true;
inherit (config.snowfallorg.user) name;
};

programs = {
graphical = {
apps = {
thunderbird = enabled;
zathura = enabled;
};

bars = {
waybar = {
fullSizeOutputs = [
"DP-1"
"HDMI-A-1"
];
condensedOutputs = [ "DP-3" ];
};
};

browsers = {
firefox = {
gpuAcceleration = true;
hardwareDecoding = true;
};
};

wms = {
hyprland = {
enable = true;
# enableDebug = true;

appendConfig = # bash
''
exec-once = hyprctl setcursor ${config.${namespace}.theme.gtk.cursor.name} ${
builtins.toString config.${namespace}.theme.gtk.cursor.size
}
'';

};
};
};

terminal = {
tools = {
git = {
enable = true;
};

run-as-service = enabled;
ssh = enabled;
};
};
};

services = {
hyprpaper = enabled;

rnnoise = enabled;

sops = {
enable = true;
defaultSopsFile = lib.snowfall.fs.get-file "secrets/gwen/default.yaml";
sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
};
};

system = {
xdg = enabled;
};

suites = {
art = enabled;
business = enabled;
common = enabled;
desktop = enabled;

development = {
enable = true;

dockerEnable = true;
gameEnable = true;
kubernetesEnable = true;
nixEnable = true;
sqlEnable = true;
};

emulation = enabled;
games = enabled;
music = enabled;
networking = enabled;
photo = enabled;
social = enabled;
video = enabled;
};

theme.stylix = enabled;
};

home.stateVersion = "24.05";
}
42 changes: 42 additions & 0 deletions modules/nixos/home/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
config,
lib,
options,
namespace,
...
}:
let
inherit (lib) types mkAliasDefinitions;
inherit (lib.${namespace}) mkOpt;
in
{

options.${namespace}.home = with types; {
configFile =
mkOpt attrs { }
"A set of files to be managed by home-manager's <option>xdg.configFile</option>.";
extraOptions = mkOpt attrs { } "Options to pass directly to home-manager.";
file = mkOpt attrs { } "A set of files to be managed by home-manager's <option>home.file</option>.";
};

config = {
${namespace}.home.extraOptions = {
home.file = mkAliasDefinitions options.${namespace}.home.file;
home.stateVersion = config.system.stateVersion;
xdg.configFile = mkAliasDefinitions options.${namespace}.home.configFile;
xdg.enable = true;
};

home-manager = {
# enables backing up existing files instead of erroring if conflicts exist
backupFileExtension = "hm.old";

useGlobalPkgs = true;
useUserPackages = true;

users.${config.${namespace}.user.name} = mkAliasDefinitions options.${namespace}.home.extraOptions;

verbose = true;
};
};
}
69 changes: 69 additions & 0 deletions modules/nixos/nix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
config,
lib,
namespace,
...
}:
let
inherit (lib) mkDefault mkIf mkForce;

cfg = config.${namespace}.nix;
in
{
imports = [ (lib.snowfall.fs.get-file "modules/shared/nix/default.nix") ];

config = mkIf cfg.enable {
documentation = {
man.generateCaches = mkDefault true;

nixos = {
enable = true;

options = {
warningsAreErrors = true;
splitBuild = true;
};
};
};

nix = {
# make builds run with low priority so my system stays responsive
daemonCPUSchedPolicy = "batch";
daemonIOSchedClass = "idle";
daemonIOSchedPriority = 7;

gc = {
dates = "Sun *-*-* 03:00";
};

optimise = {
automatic = true;
dates = [ "04:00" ];
};

settings = {
# bail early on missing cache hits
connect-timeout = 5;
experimental-features = mkForce "cgroups nix-command flakes";
keep-going = true;
use-cgroups = true;

substituters = [
"https://anyrun.cachix.org"
"https://hyprland.cachix.org"
"https://nixpkgs-wayland.cachix.org"
];
trusted-public-keys = [
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
];
};

# flake-utils-plus
generateNixPathFromInputs = true;
generateRegistryFromInputs = true;
linkInputs = true;
};
};
}
4 changes: 1 addition & 3 deletions systems/x86_64-linux/grovetender/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ in
imports = [
./hardware.nix
];
networking.hostName = "grovetender"; # Define your hostname.

elythnix = {
elyth = {
nix = enabled;

archetypes = {
Expand Down
36 changes: 36 additions & 0 deletions systems/x86_64-linux/grovetender/networking.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
_: {
networking = {
networkmanager = {
ensureProfiles = {
profiles = {
dib = {
ipv4 = {
dns-search = "~doitbestcorp.com";
method = "auto";
};
};
};
};
};
};

systemd = {
network.networks = {
# wired interfaces e.g. ethernet
"30-network-defaults-wired" = {
matchConfig.Name = "en* | eth* | usb*";
networkConfig = {
# Address = "192.168.1.3/24";
# Gateway = "192.168.1.1";
DHCP = "ipv4";
MulticastDNS = true;
# IPv6AcceptRA = true;
# IPForward = "yes";
# IPMasquerade = "no";
};
};
};

services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug";
};
}

0 comments on commit 0580d48

Please # to comment.