feat: Added server stuff

This commit is contained in:
uttarayan21
2025-01-02 15:58:40 +05:30
parent 7c7afbc890
commit e3596c2761
7 changed files with 4886 additions and 84 deletions

View File

@@ -1,7 +1,7 @@
{ {
pkgs, pkgs,
inputs, inputs,
device, device,
... ...
}: { }: {
# import the home-manager module # import the home-manager module
@@ -12,7 +12,7 @@ device,
enable = device.hasGui; enable = device.hasGui;
# the specified packages as well as 1Password CLI will be # the specified packages as well as 1Password CLI will be
# automatically installed and configured to use shell plugins # automatically installed and configured to use shell plugins
plugins = with pkgs; [awscli2 cachix cargo]; # plugins = with pkgs; [awscli2 cachix cargo];
}; };
}; };
} }

5
flake.lock generated
View File

@@ -688,8 +688,9 @@
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "flake-utils", "owner": "numtide",
"type": "indirect" "repo": "flake-utils",
"type": "github"
} }
}, },
"flake-utils_4": { "flake-utils_4": {

157
flake.nix
View File

@@ -3,6 +3,7 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs/master"; nixpkgs-master.url = "github:nixos/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -230,86 +231,100 @@
overlays = import ./overlays.nix { overlays = import ./overlays.nix {
inherit inputs; inherit inputs;
}; };
in rec { in
nixosConfigurations = let rec {
devices = nixos_devices; nixosConfigurations = let
in devices = nixos_devices;
import ./nixos/device.nix { in
inherit devices inputs nixpkgs home-manager overlays nur; import ./nixos/device.nix {
}; inherit devices inputs nixpkgs home-manager overlays nur;
};
darwinConfigurations = let darwinConfigurations = let
devices = darwin_devices; devices = darwin_devices;
in in
import ./darwin/device.nix { import ./darwin/device.nix {
inherit devices inputs nixpkgs home-manager overlays nix-darwin; inherit devices inputs nixpkgs home-manager overlays nix-darwin;
}; };
homeConfigurations = let homeConfigurations = let
devices = linux_devices; devices = linux_devices;
in in
(import ./linux/device.nix { (import ./linux/device.nix {
inherit devices inputs nixpkgs home-manager overlays; inherit devices inputs nixpkgs home-manager overlays;
}) })
// { // {
deck = let deck = let
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
inherit overlays; inherit overlays;
system = "x86_64-linux"; system = "x86_64-linux";
};
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs;
}; };
modules = [{nixpkgs.config.allowUnfree = true;} ./deck.nix]; in
}; home-manager.lib.homeManagerConfiguration {
}; inherit pkgs;
extraSpecialArgs = {
inherit inputs;
};
modules = [{nixpkgs.config.allowUnfree = true;} ./deck.nix];
};
};
deploy = { deploy = {
nodes = { nodes = {
mirai = { mirai = {
hostname = "mirai"; hostname = "mirai";
profiles.system = { profiles.system = {
sshUser = "fs0c131y"; sshUser = "fs0c131y";
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.mirai; path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.mirai;
user = "root"; user = "root";
};
}; };
}; ryu = {
ryu = { hostname = "ryu";
hostname = "ryu"; profiles.system = {
profiles.system = { sshUser = "servius";
sshUser = "servius"; path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.ryu;
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.ryu; user = "root";
user = "root"; };
}; };
}; kuro = {
kuro = { hostname = "kuro";
hostname = "kuro"; profiles.system = {
profiles.system = { sshUser = "fs0c131y";
sshUser = "fs0c131y"; path = inputs.deploy-rs.lib.aarch64-darwin.activate.darwin self.darwinConfigurations.kuro;
path = inputs.deploy-rs.lib.aarch64-darwin.activate.darwin self.darwinConfigurations.kuro; user = "root";
user = "root"; };
}; };
}; deoxys = {
deoxys = { hostname = "deoxys";
hostname = "deoxys"; profiles.system = {
profiles.system = { sshUser = "servius";
sshUser = "servius"; path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.deoxys;
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.deoxys; user = "root";
user = "root"; };
}; };
}; deck = {
deck = { hostname = "deck";
hostname = "deck"; profiles.system = {
profiles.system = { sshUser = "deck";
sshUser = "deck"; path = inputs.deploy-rs.lib.x86_64-linux.activate.home-manager self.homeConfigurations.deck;
path = inputs.deploy-rs.lib.x86_64-linux.activate.home-manager self.homeConfigurations.deck; user = "deck";
user = "deck"; };
}; };
}; };
}; };
}; }
}; // flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
};
in {
devShells = {
default = pkgs.mkShell {
packages = with pkgs; [sops just];
};
};
}
);
} }

View File

@@ -9,12 +9,14 @@
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
./disk-config.nix ./disk-config.nix
]; ];
boot.loader.grub = { boot.loader.systemd-boot.enable = true;
# no need to set devices, disko will add all devices that have a EF02 partition to the list already boot.loader.efi.canTouchEfiVariables = true;
# devices = [ ]; # boot.loader.grub = {
efiSupport = true; # # no need to set devices, disko will add all devices that have a EF02 partition to the list already
efiInstallAsRemovable = true; # # devices = [ ];
}; # efiSupport = true;
# efiInstallAsRemovable = true;
# };
services.openssh.enable = true; services.openssh.enable = true;
environment.systemPackages = map lib.lowPrio [ environment.systemPackages = map lib.lowPrio [

View File

@@ -8,7 +8,7 @@
type = "gpt"; type = "gpt";
partitions = { partitions = {
boot = { boot = {
size = "512M"; size = "1G";
type = "EF00"; type = "EF00";
content = { content = {
type = "mdraid"; type = "mdraid";
@@ -32,7 +32,7 @@
type = "gpt"; type = "gpt";
partitions = { partitions = {
boot = { boot = {
size = "512M"; size = "1G";
type = "EF00"; type = "EF00";
content = { content = {
type = "mdraid"; type = "mdraid";

4784
server/facter.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -22,7 +22,7 @@
}; };
# Slightly experimental: Like generic, but with nixos-facter (https://github.com/numtide/nixos-facter) # Slightly experimental: Like generic, but with nixos-facter (https://github.com/numtide/nixos-facter)
# nix run github:nix-community/nixos-anywhere -- --flake .#generic-nixos-facter --generate-hardware-config nixos-facter facter.json root@sh.darksailor.dev # nix run github:nix-community/nixos-anywhere -- --flake .#facter --generate-hardware-config nixos-facter facter.json root@sh.darksailor.dev
nixosConfigurations.facter = nixpkgs.lib.nixosSystem { nixosConfigurations.facter = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [