diff options
author | sefidel <contact@sefidel.net> | 2022-02-20 11:13:04 +0900 |
---|---|---|
committer | sefidel <contact@sefidel.net> | 2022-02-20 11:52:17 +0900 |
commit | 0200ef58246e45bc28412c57dcd6f6cec41f47a9 (patch) | |
tree | 17cf7adf2053ae0d62f357721e54d2faf5c42c3d | |
parent | 4f341a49d08c80676e69ceb8a13942cfdc692778 (diff) | |
download | nixrc-0200ef58246e45bc28412c57dcd6f6cec41f47a9.tar.gz nixrc-0200ef58246e45bc28412c57dcd6f6cec41f47a9.zip |
feat(nixos): add beta
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | nixos/beta/configuration.nix | 55 | ||||
-rw-r--r-- | nixos/beta/hardware-configuration.nix | 26 | ||||
-rw-r--r-- | nixos/default.nix | 10 |
4 files changed, 93 insertions, 1 deletions
diff --git a/README.md b/README.md index 590b1f2..716f170 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,9 @@ 7. Happy hacking :) +## Systems +`alpha` - My main system. +`beta` - Raspberry Pi, currently runs ZNC bouncer. ## Resources + **Flakes** diff --git a/nixos/beta/configuration.nix b/nixos/beta/configuration.nix new file mode 100644 index 0000000..3bad8be --- /dev/null +++ b/nixos/beta/configuration.nix @@ -0,0 +1,55 @@ +{ config, pkgs, ... }: + +{ + boot.loader.grub.enable = false; + boot.loader.generic-extlinux-compatible.enable = true; + + networking.hostName = "beta"; # Define your hostname. + + # Set your time zone. + time.timeZone = "Asia/Seoul"; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.core = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + }; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + services.openssh.passwordAuthentication = false; + + # Enable the ZNC IRC Bouncer. + services.znc = { + enable = true; + openFirewall = true; + useLegacyConfig = false; + modulePackages = with pkgs.zncModules; [ clientbuffer playback ]; + + config = { + LoadModule = [ "webadmin" ]; + User.zachel = { + Admin = true; + Nick = "zachel"; + RealName = "zachel"; + QuitMsg = "Bye: Quitting"; + LoadModule = [ "chansaver" "controlpanel" ]; + Pass.password = { + # xkcdpass, not exposed to public. + Method = "sha256"; + Hash = "8de38b14204314fa2887a503661b5a5fb74e4e46d36c05777be01a5b6eb24fdc"; + Salt = "/mMuEH!TX+n:CMtXcQ4U"; + }; + }; + }; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "22.05"; # Did you read the comment? + +} diff --git a/nixos/beta/hardware-configuration.nix b/nixos/beta/hardware-configuration.nix new file mode 100644 index 0000000..9191ca6 --- /dev/null +++ b/nixos/beta/hardware-configuration.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = lib.mkDefault false; + networking.interfaces.eth0.useDHCP = lib.mkDefault true; + networking.interfaces.wlan0.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; + # high-resolution display + hardware.video.hidpi.enable = lib.mkDefault true; +} diff --git a/nixos/default.nix b/nixos/default.nix index 65bff77..e1b725a 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -1,4 +1,4 @@ -{ self, unstable, ... } @ inputs: +{ self, unstable, unstable-small, ... } @ inputs: { alpha = self.lib.mkSystem { @@ -10,4 +10,12 @@ ./modules/cachix ]; }; + + beta = self.lib.mkSystem { + name = "beta"; + nixpkgs = unstable-small; + extraModules = [ + ./modules/security.nix + ]; + }; } |