first attempt at ship
This commit is contained in:
parent
333ecafb68
commit
76ac9b9ee3
3 changed files with 87 additions and 16 deletions
36
flake.nix
36
flake.nix
|
|
@ -5,30 +5,38 @@
|
|||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
disko.url = "github:nix-community/disko";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, home-manager, ... }:
|
||||
outputs = { self, nixpkgs, nixpkgs-stable, flake-utils, home-manager, disko, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
mkHost = { hostname, isInstall ? false }: nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
specialArgs = {
|
||||
inherit system;
|
||||
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
|
||||
isInstall = isInstall;
|
||||
};
|
||||
modules =
|
||||
[
|
||||
./hosts/${hostname}/configuration.nix
|
||||
./modules/common.nix
|
||||
./modules/users/alisceon.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
]
|
||||
++ nixpkgs.lib.optional isInstall disko.nixosModules.disko
|
||||
++ nixpkgs.lib.optional isInstall ./hosts/${hostname}/disko.nix;
|
||||
};
|
||||
in {
|
||||
nixosConfigurations.laptop = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
inherit system pkgs;
|
||||
};
|
||||
modules = [
|
||||
./hosts/electra/configuration.nix
|
||||
./modules/common.nix
|
||||
./modules/users/alisceon.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
];
|
||||
nixosConfigurations = {
|
||||
laptop = mkHost { hostname = "electra"; };
|
||||
laptop-install = mkHost { hostname = "electra"; isInstall = true; };
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,23 @@
|
|||
[ ./hardware-configuration.nix ];
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-partlabel/luks";
|
||||
|
||||
boot.resumeDevice = "/dev/vg0/swap";
|
||||
|
||||
time.timeZone = "Europe/Stockholm";
|
||||
i18n.defaultLocale = "sv_SE.UTF-8";
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
fileSystems."/".options = [ "compress=zstd" ];
|
||||
|
||||
networking.hostName = "electra";
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
time.timeZone = "UTC";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
|
|
|
|||
52
hosts/electra/disko.nix
Normal file
52
hosts/electra/disko.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
device = "/dev/nvme0n1";
|
||||
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "512M";
|
||||
type = "EF00"; # EFI system partition
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
|
||||
luks = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "cryptroot";
|
||||
settings.allowDiscards = true;
|
||||
content = {
|
||||
type = "lvm_pv";
|
||||
vg = "vg0";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
swap = {
|
||||
size = "32G"; # Adjust to your RAM size
|
||||
content = {
|
||||
type = "swap";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
|
||||
lvm_vgs.vg0 = {
|
||||
lvs = {
|
||||
root = {
|
||||
size = "100%FREE";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "btrfs";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue