hosts/dandelion: init
This commit is contained in:
parent
a1510113a5
commit
d13a8e5cd4
7 changed files with 107 additions and 3 deletions
|
|
@ -2,8 +2,10 @@
|
|||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs-raccoon.url = "github:NixOS/nixpkgs/nixos-22.11";
|
||||
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager-raccoon.url = "github:nix-community/home-manager/release-22.11";
|
||||
home-manager-stable.url = "github:nix-community/home-manager/release-23.11";
|
||||
neovim-nightly.url = "github:nix-community/neovim-nightly-overlay";
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
||||
agenix.url = "github:ryantm/agenix";
|
||||
|
|
@ -13,6 +15,7 @@
|
|||
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
home-manager-raccoon.inputs.nixpkgs.follows = "nixpkgs-raccoon";
|
||||
home-manager-stable.inputs.nixpkgs.follows = "nixpkgs-stable";
|
||||
neovim-nightly.inputs.nixpkgs.follows = "nixpkgs";
|
||||
nixos-generators.inputs.nixpkgs.follows = "nixpkgs";
|
||||
spicetify-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
|
@ -46,7 +49,7 @@
|
|||
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, agenix, nixos-generators, nixpkgs, nixpkgs-raccoon, ... } @ inputs:
|
||||
outputs = { self, agenix, nixos-generators, nixpkgs, nixpkgs-raccoon, nixpkgs-stable, ... } @ inputs:
|
||||
let
|
||||
overlays = (import ./overlays)
|
||||
++ [(final: prev: {
|
||||
|
|
@ -81,6 +84,7 @@
|
|||
];
|
||||
}];
|
||||
nixosConfigurations."sugarcane" = mkSystem nixpkgs-raccoon "sugarcane" "x86_64-linux" false [];
|
||||
nixosConfigurations."dandelion" = mkSystem nixpkgs-stable "dandelion" "aarch64-linux" false [];
|
||||
|
||||
packages."x86_64-linux" =
|
||||
let
|
||||
|
|
|
|||
24
hosts/dandelion/default.nix
Normal file
24
hosts/dandelion/default.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ config, inputs, modules, modulesPath, overlays, pkgs, ... }: {
|
||||
networking.hostName = "dandelion";
|
||||
system.stateVersion = "23.11";
|
||||
time.timeZone = "Australia/Melbourne";
|
||||
|
||||
imports = with modules.system; [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
inputs.home-manager-stable.nixosModule
|
||||
|
||||
base
|
||||
home-manager
|
||||
input
|
||||
nix-stable
|
||||
security
|
||||
#wireguard
|
||||
|
||||
./filesystem.nix
|
||||
./kernel.nix
|
||||
./networking.nix
|
||||
./packages.nix
|
||||
|
||||
../../users/hana
|
||||
];
|
||||
}
|
||||
34
hosts/dandelion/filesystem.nix
Normal file
34
hosts/dandelion/filesystem.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
bind = src: {
|
||||
depends = [ "/nix" ];
|
||||
device = src;
|
||||
fsType = "none";
|
||||
neededForBoot = true;
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
mkLabelMount = label: type: lazy: {
|
||||
device = "/dev/disk/by-label/${label}";
|
||||
fsType = type;
|
||||
options = [ "defaults" "relatime" ] ++ lib.optionals lazy [ "nofail" ];
|
||||
};
|
||||
mkBtrfsMount = name: subvol: atime: mkLabelMount name "btrfs" false // {
|
||||
options = [ "autodefrag" "compress=zstd:3" "defaults" "discard=async" "space_cache=v2" "ssd" "subvol=${subvol}" (if atime then "relatime" else "noatime") ];
|
||||
};
|
||||
submount = mkBtrfsMount "DANDELION";
|
||||
in {
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "rootfs";
|
||||
fsType = "tmpfs";
|
||||
options = [ "defaults" "size=12G" "mode=755" ];
|
||||
};
|
||||
|
||||
"/boot" = mkLabelMount "UEFI" "vfat" true;
|
||||
"/nix" = submount "/@/nix" false;
|
||||
"/persist" = (submount "/@/persist" true) // { neededForBoot = true; };
|
||||
"/persist/.snapshots" = submount "/snap/persist" false;
|
||||
"/var/log/journal" = bind "/persist/journal";
|
||||
};
|
||||
}
|
||||
18
hosts/dandelion/kernel.nix
Normal file
18
hosts/dandelion/kernel.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ config, inputs, pkgs, ... }: {
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = false;
|
||||
efi.canTouchEfiVariables = true;
|
||||
grub = {
|
||||
enable = true;
|
||||
device = "/dev/sda";
|
||||
};
|
||||
};
|
||||
initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" ];
|
||||
initrd.kernelModules = [ "nvme" ];
|
||||
kernel.sysctl = {
|
||||
"kernel.core_pattern" = "|/bin/false";
|
||||
"kernel.sysrq" = 1;
|
||||
};
|
||||
};
|
||||
}
|
||||
10
hosts/dandelion/networking.nix
Normal file
10
hosts/dandelion/networking.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, ... }: {
|
||||
networking = {
|
||||
useDHCP = true;
|
||||
|
||||
# extraHosts = ''
|
||||
# 10.100.0.3 blossom
|
||||
# 10.100.0.4 strawberry
|
||||
# '';
|
||||
};
|
||||
}
|
||||
14
hosts/dandelion/packages.nix
Normal file
14
hosts/dandelion/packages.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ lib, pkgs, ... }: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
htop
|
||||
jq
|
||||
neovim
|
||||
rsync
|
||||
sshfs
|
||||
wget
|
||||
|
||||
kitty.terminfo
|
||||
];
|
||||
environment.variables.EDITOR = "nvim";
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
extraGroups = [ "wheel" ];
|
||||
shell = pkgs.zsh;
|
||||
uid = 1002;
|
||||
passwordFile = config.age.secrets.passwd.path;
|
||||
hashedPassword = "$y$j9T$BxnsFaGwBfSKe4jAJaaxI.$cpFtu8fzFhKalIV3WGuA2jz4//KJBwhiybpnlmoZPy.";
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPru5eTBvHJ4ZmrrzPRHCGM09wQP/ZHSaKYalDuBVO15 rin@blossom"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ5l9t8dc6mPsKKYqZlPKvhOdyqz+DS5UOcvHuh3uVGt @strawberry"
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
home = {
|
||||
username = "hana";
|
||||
homeDirectory = "/home/hana";
|
||||
stateVersion = "21.11";
|
||||
stateVersion = "23.11";
|
||||
};
|
||||
|
||||
imports = with modules.user; [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue