Skip to content

Commit

Permalink
module rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
emanueljg committed Mar 15, 2024
1 parent c359ded commit ee8423e
Show file tree
Hide file tree
Showing 63 changed files with 459 additions and 609 deletions.
7 changes: 3 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
statix = { enable = true; };
};
settings = {
statix.ignore = [ "*hardware{_,-}configuration.nix" ];
statix.ignore = [ "*hardware_configuration.nix" ];
};
};
};
Expand All @@ -114,9 +114,8 @@

flake =
let
inherit (import ./modules) utils mkHosts;

hosts = mkHosts { inherit inputs; };
hosts = import ./modules/hosts;
utils = import ./utils.nix;

rawInputs = {
inherit (inputs) nixpkgs nixpkgs-unstable nixos-unstable;
Expand Down
1 change: 0 additions & 1 deletion modules/_oakleaf/default.nix

This file was deleted.

6 changes: 0 additions & 6 deletions modules/archived/mysql.nix

This file was deleted.

27 changes: 27 additions & 0 deletions modules/base/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ lib, ... }: {
imports = [
./efi-grub.nix

./aliases.nix
./allow-unfree.nix
./colmena.nix
./direnv.nix
./enable-flakes.nix
./FIXES.nix
./git.nix
./helix
./hm.nix
./pass.nix
./pkgs.nix
./sops.nix
./ssh.nix
./starship.nix
./swedish-locale.nix
./user.nix
./zsh.nix
./opengl.nix
];

custom.efi-grub.enable = lib.mkDefault true;

}
23 changes: 23 additions & 0 deletions modules/base/efi-grub.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ config, lib, ... }:
let cfg = config.custom.efi-grub; in with lib; {
options.custom.efi-grub.enable = mkEnableOption "efi-grub";

config = lib.mkIf cfg.enable {
boot = {
#kernelParams = [ "quiet" "splash" ];
loader = {
efi.canTouchEfiVariables = true;
timeout = 10;
grub = {
enable = true;
efiSupport = true;
device = "nodev";
extraConfig = ''
GRUB_HIDDEN_TIMEOUT=10
GRUB_HIDDEN_TIMEOUT_QUIET=false
'';
};
};
};
};
}
3 changes: 3 additions & 0 deletions modules/base/opengl.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_: {
hardware.opengl.enable = true;
}
File renamed without changes.
5 changes: 2 additions & 3 deletions modules/base/ssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ with lib; {
};
# allow these clients to connect
users.users."ejg".openssh.authorizedKeys.keyFiles = [
./_pubkeys/id_rsa_mothership.pub
./pubkeys/id_rsa_mothership.pub
];
# let colmena know about the identity file
my.home.sessionVariables."SSH_CONFIG_FILE" = pkgs.writeText "colmena-ssh-config" ''
Expand All @@ -37,8 +37,7 @@ with lib; {
startAgent = true;
extraConfig =
let
inherit ((import ../.)) mkHosts;
hosts = mkHosts { };
hosts = import ../hosts;
hostStrings =
lib.mapAttrsToList
(
Expand Down
9 changes: 0 additions & 9 deletions modules/can-hibernate.nix

This file was deleted.

14 changes: 0 additions & 14 deletions modules/crown/configuration.nix

This file was deleted.

42 changes: 0 additions & 42 deletions modules/crown/hardware_configuration.nix

This file was deleted.

18 changes: 0 additions & 18 deletions modules/crown/invidious.nix

This file was deleted.

80 changes: 0 additions & 80 deletions modules/default.nix

This file was deleted.

16 changes: 0 additions & 16 deletions modules/fenix/configuration.nix

This file was deleted.

36 changes: 0 additions & 36 deletions modules/fenix/hardware-configuration.nix

This file was deleted.

32 changes: 32 additions & 0 deletions modules/hosts/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
rec {
"void" = {
ip = "192.168.0.3";
modules = [ ./void ];
};

"seneca" = {
ip = "192.168.0.4";
modules = [ ./seneca ];
};

"_oakleaf" = {
ip = "127.0.0.1";
modules = [ ./oakleaf ];
};

"oakleaf-home" = _oakleaf // {
modules = [ ./oakleaf/spec-home.nix ];
};

"oakleaf-laptop" = _oakleaf;

"weasel" = {
ip = "127.0.0.1";
modules = [ ./weasel ];
};
"stoneheart" = {
ip = "127.0.0.1";
modules = [ ./stoneheart ];
};
}

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).
_: {

imports = [
./hardware-configuration.nix
];

networking.hostName = "oakleaf";
system.stateVersion = "23.05"; # Did you read the comment?
my.home.stateVersion = "23.05";
# nix.settings.ssl-cert-file = "/var/lib/cert.crt";
hardware.opengl.enable = true;
}
9 changes: 9 additions & 0 deletions modules/hosts/oakleaf/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
_: {

imports = [
../../pc

./configuration.nix
];

}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ config, lib, pkgs, ... }:
{

imports = [ ./. ];

services.xserver.videoDrivers = [ "displaylink" "modesetting" ];
services.xserver.displayManager.sessionCommands = ''
${lib.getBin pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0
Expand Down
Loading

0 comments on commit ee8423e

Please sign in to comment.