initial commit

This commit is contained in:
dprin 2026-03-28 09:43:39 +01:00
commit e3580500ac
7 changed files with 203 additions and 0 deletions

43
configuration.nix Normal file
View file

@ -0,0 +1,43 @@
{ config, lib, pkgs, ... }:
{
boot.loader.grub = {
enable = true;
device = "/dev/sda";
};
networking.hostName = "prin-server"; # Define your hostname.
# Configure network connections interactively with nmcli or nmtui.
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
users.users.prever = {
isNormalUser = true;
extraGroups = [ "wheel" ];
packages = with pkgs; [
git
tree
];
};
environment.systemPackages = with pkgs; [
neovim
wget
];
services.openssh.enable = true;
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
# networking.firewall.allowedUDPPorts = [ ... ];
nix = {
settings.experimental-features = [ "nix-command" "flakes" ];
};
home-manager.users.prever.home.stateVersion = "25.11";
system.stateVersion = "25.11";
}

48
flake.lock generated Normal file
View file

@ -0,0 +1,48 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1774647770,
"narHash": "sha256-UNNi14XiqRWWjO8ykbFwA5wRwx7EscsC+GItOVpuGjc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "02371c05a04a2876cf92e2d67a259e8f87399068",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1774388614,
"narHash": "sha256-tFwzTI0DdDzovdE9+Ras6CUss0yn8P9XV4Ja6RjA+nU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1073dad219cb244572b74da2b20c7fe39cb3fa9e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

27
flake.nix Normal file
View file

@ -0,0 +1,27 @@
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, ... }: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
nixosConfigurations."prever" = nixpkgs.lib.nixosSystem {
modules = [
home-manager.nixosModules.default
./hardware-configuration.nix
./configuration.nix
./modules
];
};
};
}

View file

@ -0,0 +1,26 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/7d06eddb-8692-4fff-8308-f860ca6aeb55";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/7aa0eb64-3587-4dce-9fc2-fcdc4a712abb"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

7
modules/default.nix Normal file
View file

@ -0,0 +1,7 @@
{...}:
{
imports = [
./fish.nix
./nginx.nix
];
}

33
modules/fish.nix Normal file
View file

@ -0,0 +1,33 @@
{pkgs, ...}: {
programs.fish.enable = true;
users.users.prever.shell = pkgs.fish;
home-manager.users.prever = {
programs.zoxide.enable = true;
programs.starship.enable = true;
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
programs.fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting
enable_transience # (from starship)
'';
shellAbbrs = {
c = "clear";
gc = "git commit";
gp = "git push";
gP = "git pull";
gs = "git status";
nr = "sudo nixos-rebuild switch --flake ~/nix/#prever";
};
};
};
}

19
modules/nginx.nix Normal file
View file

@ -0,0 +1,19 @@
{...}:
{
services.nginx = {
enable = true;
user = "prever";
group = "users";
virtualHosts."yelbakri.dev" = {
addSSL = true;
enableACME = true;
root = "/var/www";
};
};
security.acme = {
acceptTerms = true;
defaults.email = "yousefelbakri09@gmail.com";
};
}