commit 6163a8b53fea0378f3575896bf269f8f47953da0 Author: Charlotte Som Date: Wed Nov 27 03:01:50 2024 +0000 Initial commit diff --git a/flake/activate.sh b/flake/activate.sh new file mode 100755 index 0000000..0515e19 --- /dev/null +++ b/flake/activate.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +sudo nixos-rebuild --verbose --flake path:/srv/flake switch diff --git a/flake/flake.lock b/flake/flake.lock new file mode 100644 index 0000000..0d28e77 --- /dev/null +++ b/flake/flake.lock @@ -0,0 +1,128 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flakey-profile": { + "locked": { + "lastModified": 1712898590, + "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", + "owner": "lf-", + "repo": "flakey-profile", + "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", + "type": "github" + }, + "original": { + "owner": "lf-", + "repo": "flakey-profile", + "type": "github" + } + }, + "lix": { + "inputs": { + "flake-utils": "flake-utils", + "flakey-profile": "flakey-profile", + "lix": "lix_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729360442, + "narHash": "sha256-6U0CyPycIBc04hbYy2hBINnVso58n/ZyywY2BD3hu+s=", + "rev": "9098ac95768f7006d7e070b88bae76939f6034e6", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/9098ac95768f7006d7e070b88bae76939f6034e6.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz" + } + }, + "lix_2": { + "flake": false, + "locked": { + "lastModified": 1729298361, + "narHash": "sha256-hiGtfzxFkDc9TSYsb96Whg0vnqBVV7CUxyscZNhed0U=", + "rev": "ad9d06f7838a25beec425ff406fe68721fef73be", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/ad9d06f7838a25beec425ff406fe68721fef73be.tar.gz?rev=ad9d06f7838a25beec425ff406fe68721fef73be" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1731797254, + "narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1732521221, + "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "lix": "lix", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake/flake.nix b/flake/flake.nix new file mode 100644 index 0000000..742cb0e --- /dev/null +++ b/flake/flake.nix @@ -0,0 +1,31 @@ +{ + description = "cerulea system flake"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + lix = { + url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, nixpkgs-unstable, lix, ... }@inputs: { + nixosConfigurations = { + cerulea-1 = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + unstable-pkgs = nixpkgs-unstable.legacyPackages."x86_64-linux"; + inherit inputs; + }; + + modules = [ + lix.nixosModules.default + ({...}: { system.stateVersion = "23.11"; }) + ./system/cerulea-1/hardware-configuration.nix + ./system/cerulea-1/networking.nix + ./system/configuration.nix + ]; + }; + }; + }; +} diff --git a/flake/system/cerulea-1/hardware-configuration.nix b/flake/system/cerulea-1/hardware-configuration.nix new file mode 100644 index 0000000..5e7b44e --- /dev/null +++ b/flake/system/cerulea-1/hardware-configuration.nix @@ -0,0 +1,9 @@ +{ modulesPath, ... }: +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + boot.loader.grub.device = "/dev/sda"; + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ]; + boot.initrd.kernelModules = [ "nvme" ]; + fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; + +} diff --git a/flake/system/cerulea-1/networking.nix b/flake/system/cerulea-1/networking.nix new file mode 100644 index 0000000..7afe847 --- /dev/null +++ b/flake/system/cerulea-1/networking.nix @@ -0,0 +1,35 @@ +{ lib, ... }: { + # This file was populated at runtime with the networking + # details gathered from the active system. + networking = { + nameservers = [ "2a01:4ff:ff00::add:2" + "2a01:4ff:ff00::add:1" + "185.12.64.1" + ]; + defaultGateway = "172.31.1.1"; + defaultGateway6 = { + address = "fe80::1"; + interface = "eth0"; + }; + dhcpcd.enable = false; + usePredictableInterfaceNames = lib.mkForce false; + interfaces = { + eth0 = { + ipv4.addresses = [ + { address="88.198.199.29"; prefixLength=32; } + ]; + ipv6.addresses = [ + { address="2a01:4f8:c2c:228a::1"; prefixLength=64; } +{ address="fe80::9400:3ff:fee1:34e0"; prefixLength=64; } + ]; + ipv4.routes = [ { address = "172.31.1.1"; prefixLength = 32; } ]; + ipv6.routes = [ { address = "fe80::1"; prefixLength = 128; } ]; + }; + + }; + }; + services.udev.extraRules = '' + ATTR{address}=="96:00:03:e1:34:e0", NAME="eth0" + + ''; +} diff --git a/flake/system/configuration.nix b/flake/system/configuration.nix new file mode 100644 index 0000000..8bd835a --- /dev/null +++ b/flake/system/configuration.nix @@ -0,0 +1,29 @@ +{ pkgs, ... }: { + nix = { + settings.experimental-features = [ + "nix-command" + "flakes" + ]; + }; + + boot.tmp.cleanOnBoot = true; + zramSwap.enable = true; + + networking.hostName = "cerulea-1"; + time.timeZone = "UTC"; + networking.firewall.enable = false; + + services.openssh.enable = true; + services.openssh.settings.PasswordAuthentication = false; + users.users.root.openssh.authorizedKeys.keys = [''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMiGDjT86bf2DNsVPOgtvT1SGCsI5EE5bLhxiJnMaDJQ charlotte@crystal'' ]; # failsafe + + programs.zsh.enable = true; + programs.git.enable = true; + users.users.charlotte = { + isNormalUser = true; + description = "charlotte"; + extraGroups = ["wheel"]; + shell = pkgs.zsh; + }; + security.sudo.wheelNeedsPassword = false; +}