Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small nuke #1

Merged
merged 1 commit into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 31 additions & 25 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,54 +19,60 @@
};

# Define the outputs for the flake
outputs = { self, nixpkgs, home-manager, plasma-manager, ... }@inputs:
let
# Define some variables
username = "plarpoon";
stateVersion = "23.11";
in
outputs =
{ nixpkgs, home-manager, ... }@inputs:
{
nixosConfigurations = {
# Define a NixOS configuration for the 'bjorn' host
bjorn = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Import the 'bjorn' host's configuration.nix file
./hosts/bjorn/configuration.nix

./modules/nixos
# Enable Home Manager
home-manager.nixosModules.home-manager

({ config, pkgs, ... }: {
{
# Configure Home Manager
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;

system.stateVersion = stateVersion;
})
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
};
users.plarpoon.imports = [
./modules/home-manager
./users/plarpoon
];
};
}
];
specialArgs = { inherit inputs username stateVersion; };
specialArgs = {
inherit inputs;
};
};

# Define a NixOS configuration for the 'daisy' host
daisy = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Import the 'daisy' host's configuration.nix file
./hosts/daisy/configuration.nix

# Enable Home Manager
home-manager.nixosModules.home-manager

({ config, pkgs, ... }: {
{
# Configure Home Manager
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;

system.stateVersion = stateVersion;
})
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
};
};
}
];
specialArgs = { inherit inputs username stateVersion; };
specialArgs = {
inherit inputs;
};
};
};
};
Expand Down
88 changes: 44 additions & 44 deletions hosts/bjorn/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
{ config, inputs, lib, pkgs, username, stateVersion, vars, ... }:

let
sharedConfig = import ../default.nix { inherit config inputs lib pkgs username stateVersion vars; };
in
{

##FIX ME
boot.loader.grub.devices = [ "nodev" ];

imports = [
# Import your hardware configuration
./hardware-configuration.nix

# Import the shared configuration
sharedConfig
];
## My modules
kde = {
enable = true;
};

config = {
## Users
users.users = {
"${username}" = {
isNormalUser = true; # The user is a normal user (not a system user)
openssh.authorizedKeys.keys = [
## Users
users.users = {
plarpoon = {
isNormalUser = true; # The user is a normal user (not a system user)
openssh.authorizedKeys.keys =
[
# Add your SSH public key(s) here, if you plan on using SSH to connect to this user
];
extraGroups = [ "wheel" "networkmanager" ]; # The user is part of the 'wheel' and 'networkmanager' groups
};
extraGroups = [
"wheel"
"networkmanager"
]; # The user is part of the 'wheel' and 'networkmanager' groups
};
};

networking.nameservers = [
"45.90.28.0#bjorn-e38da2.dns.nextdns.io"
"2a07:a8c0::#bjorn-e38da2.dns.nextdns.io"
];

services.resolved = {
enable = true; # Enable systemd-resolved for DNS resolution
dnssec = "true"; # Enable DNSSEC for DNS resolution
domains = [ "~." ]; # Use these DNS servers for all domains
fallbackDns = [
"45.90.30.0#bjorn-e38da2.dns.nextdns.io"
"2a07:a8c1::#bjorn-e38da2.dns.nextdns.io"
];
extraConfig = ''
DNSOverTLS=yes # Use DNS over TLS for DNS resolution
'';
};
networking.nameservers = [
"45.90.28.0#bjorn-e38da2.dns.nextdns.io"
"2a07:a8c0::#bjorn-e38da2.dns.nextdns.io"
];

## Networking
networking = {
hostName = "bjorn"; # Set this system's hostname
services.resolved = {
enable = true; # Enable systemd-resolved for DNS resolution
dnssec = "true"; # Enable DNSSEC for DNS resolution
domains = [ "~." ]; # Use these DNS servers for all domains
fallbackDns = [
"45.90.30.0#bjorn-e38da2.dns.nextdns.io"
"2a07:a8c1::#bjorn-e38da2.dns.nextdns.io"
];
extraConfig = ''
DNSOverTLS=yes # Use DNS over TLS for DNS resolution
'';
};

networkmanager.enable = true; # Enable NetworkManager for network configuration
## Networking
networking = {
hostName = "bjorn"; # Set this system's hostname

useDHCP = false; # Do not use DHCP for network configuration (use static IP addresses)
};
networkmanager.enable = true; # Enable NetworkManager for network configuration

hardware.enableRedistributableFirmware = true; # Enable redistributable firmware (may be required for some hardware)
useDHCP = false; # Do not use DHCP for network configuration (use static IP addresses)
};

hardware.cpu.intel.updateMicrocode = true; # Update CPU microcode (for Intel CPUs)
hardware.enableRedistributableFirmware = true; # Enable redistributable firmware (may be required for some hardware)

system.stateVersion = stateVersion; # Set the system state version
hardware.cpu.intel.updateMicrocode = true; # Update CPU microcode (for Intel CPUs)

plasma.enable = true; # Enable KDE Plasma
};
system.stateVersion = "23.11";
}
46 changes: 28 additions & 18 deletions hosts/bjorn/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
# 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, ... }:
{
config,
lib,
modulesPath,
...
}:

{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];

fileSystems."/" =
{ device = "/dev/disk/by-uuid/31a7982a-0630-4de8-b399-76d40dbae1eb";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/31a7982a-0630-4de8-b399-76d40dbae1eb";
fsType = "btrfs";
options = [ "subvol=@" ];
};

fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/1F02-0734";
fsType = "vfat";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/1F02-0734";
fsType = "vfat";
};

swapDevices =
[ { device = "/dev/disk/by-uuid/12ac8ba7-3642-471d-af1d-66a806fe1a31"; }
];
swapDevices = [ {
device = "/dev/disk/by-uuid/12ac8ba7-3642-471d-af1d-66a806fe1a31";
} ];

# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
Expand All @@ -38,5 +46,7 @@

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode =
lib.mkDefault
config.hardware.enableRedistributableFirmware;
}
10 changes: 9 additions & 1 deletion hosts/daisy/configuration.nix
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# ...
{
networking.hostName = "daisy";
nixpkgs.hostPlatform = "x86_64-linux";
system.stateVersion = "23.11";

##remove these
fileSystems."/".label = "x";
boot.loader.grub.devices = [ "nodev" ];
}
47 changes: 35 additions & 12 deletions hosts/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
{ config, inputs, lib, pkgs, username, stateVersion, vars, ... }:
{
config,
inputs,
lib,
pkgs,
username,
stateVersion,
vars,
...
}:

let
sharedConfig = import ../modules/default.nix { inherit config inputs lib pkgs username stateVersion vars; };
sharedConfig = import ../modules/default.nix {
inherit
config
inputs
lib
pkgs
username
stateVersion
vars
;
};
in
{
imports = [
# Import the shared configuration
sharedConfig
];
imports =
[
# Import the shared configuration
sharedConfig
];

## Nix configuration
nix = {
Expand Down Expand Up @@ -54,7 +74,10 @@ in
## Set the system locale
i18n = {
defaultLocale = "it_IT.UTF-8";
supportedLocales = [ "en_US.UTF-8/UTF-8" "it_IT.UTF-8/UTF-8" ];
supportedLocales = [
"en_US.UTF-8/UTF-8"
"it_IT.UTF-8/UTF-8"
];
};

# Set the console keymap
Expand Down Expand Up @@ -100,7 +123,7 @@ in
whatsapp-for-linux # WhatsApp client

# Encryption
gnupg # OpenPGP implementation
gnupg # OpenPGP implementation

# Image Editing
gimp-with-plugins # GNU Image Manipulation Program
Expand Down Expand Up @@ -147,9 +170,9 @@ in

displayManager.sddm.enable = true; # Enable the SDDM display manager

layout.xserver.layout= "it"; # Set the keyboard layout
layout.xserver.layout = "it"; # Set the keyboard layout

## Pinentry
programs.gnupg.agent.enable= true;
programs.gnupg.agent.pinentryFlavor= "qt";
## Pinentry
programs.gnupg.agent.enable = true;
programs.gnupg.agent.pinentryFlavor = "qt";
}
11 changes: 0 additions & 11 deletions modules/default.nix

This file was deleted.

1 change: 1 addition & 0 deletions modules/home-manager/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ imports = [ ./plasma.nix ]; }
Loading