initial commit
This commit is contained in:
commit
813b424831
13 changed files with 171 additions and 0 deletions
12
.editorconfig
Normal file
12
.editorconfig
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
insert_final_newline = false
|
||||||
5
all-modules.nix
Normal file
5
all-modules.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{lib, ...}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = lib.fileset.toList (lib.fileset.fileFilter (f: f.hasExt "nix") ./modules);
|
||||||
|
}
|
||||||
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1771848320,
|
||||||
|
"narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "2fc6539b481e1d2569f25f8799236694180c0993",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
16
flake.nix
Normal file
16
flake.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs }: {
|
||||||
|
# hydraJobs = nixpkgs.lib.mapAttrs (_: value: value.config.system.build.toplevel) self.nixosConfigurations;
|
||||||
|
nixosConfigurations = {
|
||||||
|
vm = nixpkgs.lib.nixosSystem {
|
||||||
|
modules = [
|
||||||
|
./systems/vm/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
8
makefile
Normal file
8
makefile
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
build:
|
||||||
|
nix-build '<nixpkgs/nixos>' -A vm -I nixpkgs=channel:nixos-25.11 -I nixos-config=./configuration.nix
|
||||||
|
|
||||||
|
run-nographics:
|
||||||
|
QEMU_KERNEL_PARAMS=console=ttyS0 ./result/bin/run-nixos-vm -nographic; reset
|
||||||
|
|
||||||
|
run:
|
||||||
|
./result/bin/run-nixos-vm
|
||||||
7
modules/boot.nix
Normal file
7
modules/boot.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{config, pkgs, ...}:
|
||||||
|
|
||||||
|
{
|
||||||
|
boot.loader.grub.enable = true;
|
||||||
|
boot.loader.grub.device = "/dev/vda";
|
||||||
|
boot.loader.grub.useOSProber = true;
|
||||||
|
}
|
||||||
5
modules/default-packages.nix
Normal file
5
modules/default-packages.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{config, pkgs, ...}:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.vim.enable = true;
|
||||||
|
}
|
||||||
15
modules/git.nix
Normal file
15
modules/git.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{config, pkgs, lib, ...}:
|
||||||
|
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.git;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
modules.git.enable = lib.mkEnableOption "Enable git";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.git.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
16
modules/graphical.nix
Normal file
16
modules/graphical.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
{config, pkgs, lib, ...}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.graphical;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
modules.graphical.enable = lib.mkEnableOption "Enable the GUI";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.niri.enable = true;
|
||||||
|
services.displayManager.ly.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
5
modules/networkManager.nix
Normal file
5
modules/networkManager.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{config, pkgs, ...}:
|
||||||
|
|
||||||
|
{
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
}
|
||||||
16
modules/terminal.nix
Normal file
16
modules/terminal.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
{config, pkgs, lib, ...}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.terminal;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
modules.terminal.enable = lib.mkEnableOption "Enables alacritty";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
alacritty
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
20
systems/vm/configuration.nix
Normal file
20
systems/vm/configuration.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{ config, pkgs, ...}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../all-modules.nix
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
users.users.riley = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = ["wheel"];
|
||||||
|
};
|
||||||
|
|
||||||
|
modules.graphical.enable = true;
|
||||||
|
modules.terminal.enable = true;
|
||||||
|
|
||||||
|
console.keyMap = "uk";
|
||||||
|
|
||||||
|
system.stateVersion = "25.11";
|
||||||
|
}
|
||||||
19
systems/vm/hardware-configuration.nix
Normal file
19
systems/vm/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{ config, lib, pkgs, modulesPath, ...}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||||
|
boot.initrd.kernelModules = [];
|
||||||
|
boot.extraModulePackages = [];
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-uuid/ed56e12e-55cc-42e0-b94f-9a6d6bb2bdad";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue