Skip to content

Commit

Permalink
init fatalis
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Dec 17, 2023
1 parent de64ef2 commit e11e86b
Show file tree
Hide file tree
Showing 14 changed files with 406 additions and 290 deletions.
21 changes: 0 additions & 21 deletions flake.lock

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

4 changes: 0 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@
inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
wrapper-manager = {
url = "github:viperML/wrapper-manager";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down
4 changes: 0 additions & 4 deletions flake/flake.nix.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@
inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
wrapper-manager = {
url = "github:viperML/wrapper-manager";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down
36 changes: 36 additions & 0 deletions hosts/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
{
inputs,
config,
withSystem,
...
}: {
imports = [
./hermes
./fatalis
];

_module.args.mkNixos = system: extraModules: let
specialArgs = {
inherit inputs;
packages = inputs.nix-common.lib.mkPackages system inputs;
};
in
inputs.nixpkgs.lib.nixosSystem {
inherit specialArgs;

modules = [
#-- Core
inputs.nixpkgs.nixosModules.readOnlyPkgs
{nixpkgs.pkgs = (withSystem system ({pkgs, ...}: pkgs));}

config.flake.nixosModules.common
inputs.nix-common.nixosModules.default

inputs.home-manager.nixosModules.home-manager
{
home-manager.sharedModules = [
config.flake.homeModules.common
inputs.nix-common.homeModules.default
];
home-manager.extraSpecialArgs = specialArgs;
}

inputs.nh.nixosModules.default
] ++ extraModules;
};
}
49 changes: 49 additions & 0 deletions hosts/fatalis/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
lib,
pkgs,
...
}: {
networking = {
hostName = "fatalis";
networkmanager = {
enable = true;
};
};

users.mutableUsers = false;
users.users.ayats = {
isNormalUser = true;
extraGroups = ["wheel"];
password = "1234";
createHome = true;
};

security.sudo.wheelNeedsPassword = false;

system.stateVersion = "23.11";

# powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";

hardware = {
cpu.intel.updateMicrocode = true;
enableRedistributableFirmware = true;
bluetooth.enable = true;
opengl = {
enable = true;
extraPackages = with pkgs.rocmPackages; [
clr
clr.icd
];
};
};

# services.fwupd.enable = true;

# security.pam.services = {
# login.u2fAuth = true;
# sudo.u2fAuth = true;
# };

# services.thermald.enable = true;
# services.cpupower-gui.enable = true;
}
34 changes: 34 additions & 0 deletions hosts/fatalis/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
config,
withSystem,
mkNixos,
...
}: let
system = "x86_64-linux";
inherit (config.flake) nixosModules homeModules;
in {
flake.nixosConfigurations.fatalis = withSystem system ({pkgs, ...}:
mkNixos system [
#-- Host-specific
./configuration.nix
./hardware.nix
nixosModules.user-ayats

{
home-manager.sharedModules = [
./home.nix
homeModules.browser
];
}

#-- Environment
{services.xserver.displayManager.autoLogin.user = "ayats";}
# nixosModules.sway
# nixosModules.hyprland
# nixosModules.plasma5
nixosModules.gnome

#-- Other
nixosModules.tailscale
]);
}
89 changes: 89 additions & 0 deletions hosts/fatalis/hardware.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
config,
lib,
pkgs,
...
}: let
luksDevice = "luksroot";
in {
boot = {
kernelPackages = pkgs.linuxPackages_latest;

initrd = {
systemd.enable = true;
availableKernelModules = [
];

luks = {
devices.${luksDevice} = {
device = "/dev/disk/by-partlabel/LINUX_LUKS";
};
};
};

# kernel.sysctl = {
# "vm.swappiness" = 10;
# };

kernelParams = [
];

loader = {
systemd-boot = {
enable = true;
editor = false;
configurationLimit = 10;
consoleMode = "max";
};
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/efi";
};
timeout = 1;
};

tmp.useTmpfs = true;
};

fileSystems = let
mkTmpfs = {
device = "none";
fsType = "tmpfs";
options = [
"size=2G"
"mode=0755"
];
};
in {
"/" = {
device = "/dev/mapper/${luksDevice}";
fsType = "xfs";
options = [
"noatime"
];
};

${config.boot.loader.efi.efiSysMountPoint} = {
device = builtins.throw "EFI partition";
fsType = "vfat";
options = [
"x-systemd.automount"
"x-systemd.mount-timeout=15min"
"umask=077"
];
};

"/etc" = mkTmpfs;
"/bin" = mkTmpfs;
"/lib64" = mkTmpfs;
"/opt" = mkTmpfs;
"/srv" = mkTmpfs;
"/usr" = mkTmpfs;
};

# swapDevices = [
# {
# device = "/dev/disk/by-partlabel/LINUX_SWAP";
# }
# ];
}
12 changes: 12 additions & 0 deletions hosts/fatalis/home.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
pkgs,
packages,
...
}: {
nixpkgs.config.allowUnfree = true;

unsafeFlakePath = "/home/ayats/Documents/dotfiles";

home.packages = [
];
}
Loading

0 comments on commit e11e86b

Please sign in to comment.