summary refs log tree commit diff
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-12-11 21:23:21 +0100
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-12-11 21:23:21 +0100
commit5aae161f96695944010bda91b3e63b00056306fd (patch)
treebe5571b107f5c72c23e31637e4f3f7ae7e10d09b
downloadRory-Open-Architecture-5aae161f96695944010bda91b3e63b00056306fd.tar.xz
Initial commit
Signed-off-by: TheArcaneBrony <myrainbowdash949@gmail.com>
-rw-r--r--.gitignore1
-rw-r--r--flake.nix30
-rw-r--r--host/Rory-discordbots/configuration.nix116
-rw-r--r--modules/base.nix78
-rw-r--r--modules/packages/vim.nix22
-rw-r--r--modules/users.nix13
-rw-r--r--old/configuration.nix117
7 files changed, 377 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4c7f2b9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+hardware-configuration.nix
\ No newline at end of file
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..0dd50e0
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,30 @@
+# This can be built with nixos-rebuild --flake .#myhost build
+{
+  description = "Rory's services flake";
+
+  inputs = {
+    nixpkgs = {
+      # Using the nixos-unstable branch specifically, which is the
+      # closest you can get to following the channel with flakes.
+      url = "github:NixOS/nixpkgs/nixos-unstable";
+    };
+  };
+
+  # Outputs can be anything, but the wiki + some commands define their own
+  # specific keys. Wiki page: https://nixos.wiki/wiki/Flakes#Output_schema
+  outputs = { self, nixpkgs }: {
+    # nixosConfigurations is the key that nixos-rebuild looks for.
+    nixosConfigurations = {
+      Rory-discordbots = nixpkgs.lib.nixosSystem {
+        # A lot of times online you will see the use of flake-utils + a
+        # function which iterates over many possible systems. My system
+        # is x86_64-linux, so I'm only going to define that
+        system = "x86_64-linux";
+        # Import our old system configuration.nix
+        modules = [
+          ./host/Rory-discordbots/configuration.nix
+        ];
+      };
+    };
+  };
+}
\ No newline at end of file
diff --git a/host/Rory-discordbots/configuration.nix b/host/Rory-discordbots/configuration.nix
new file mode 100644
index 0000000..7252a9e
--- /dev/null
+++ b/host/Rory-discordbots/configuration.nix
@@ -0,0 +1,116 @@
+{ config, pkgs, ... }:
+
+{
+  imports =
+    [
+       ../../../modules/packages/vim.nix
+    ];
+
+  boot = {
+	loader = {
+		grub = {
+			enable = true;
+			version = 2;
+			device = "/dev/sda"; # nodev for EFI only
+			
+			# EFI
+			efiSupport = false;
+			efiInstallAsRemovable = false;
+		};
+	};
+  };
+
+  networking = {
+	hostName = "RoryNix";
+	networkmanager.enable = true;
+	wireless.enable = false;
+  	
+	firewall = {
+		enable = false;
+		# allowedTCPPorts = [ ... ];
+		# allowedUDPPorts = [ ... ];
+	};
+  };
+
+  time.timeZone = "Europe/Brussels";
+  i18n.defaultLocale = "en_US.UTF-8";
+
+  services = {
+ 	xserver = {
+		enable = true;
+  		videoDrivers = [ "intel" ];
+  		desktopManager.gnome.enable = true;
+		libinput.enable = true;
+		layout = "us";
+		modules = [ pkgs.xorg.xf86videointel ];
+	};
+	gnome = {
+		
+    		core-developer-tools.enable = false;
+		core-utilities.enable = false;
+		tracker-miners.enable = false;
+		tracker.enable = false;
+	};
+
+	printing.enable = false;
+	openssh = {
+          enable = true;
+          extraConfig = ''
+            MaxAuthTries 32
+            '';
+	};	
+  };
+  security.sudo.wheelNeedsPassword = false;
+  nixpkgs.config.allowUnfree = true;
+
+  sound.enable = true;
+  hardware.pulseaudio.enable = true;
+
+  users.users.Rory = {
+    isNormalUser = true;
+    extraGroups = [ "wheel" ];
+    packages = with pkgs; [
+      #xterm
+      gnomeExtensions.vitals
+      gnomeExtensions.runcat
+    ];
+    initialPassword = "password";
+  };
+
+  environment.systemPackages = with pkgs; [
+    wget
+    neofetch
+    lnav
+    pciutils
+    zsh
+    gnome-console
+    feh
+    git
+    lsd
+    #nerdfonts
+    #element-web
+    sshfs
+    cinnamon.nemo
+    firefox-bin
+    kitty.terminfo
+    glxinfo
+    #epiphany
+    # Various extensions...
+    # - Gnome
+    #gnomeExtensions.vitals
+    #gnomeExtensions.runcat
+    #  - Dont work on gnome 43:
+    #gnomeExtensions.undecorate
+    #gnomeExtensions.inactivity
+    #gnomeExtensions.left-clock
+    # - Vim
+    vimPlugins.vim-nix
+  ];
+  fonts.fonts = with pkgs; [
+    (nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
+  ];
+
+
+  system.stateVersion = "22.11"; # DO NOT EDIT!
+}
+
diff --git a/modules/base.nix b/modules/base.nix
new file mode 100644
index 0000000..8f2102b
--- /dev/null
+++ b/modules/base.nix
@@ -0,0 +1,78 @@
+{ config, pkgs, ... }:
+
+{
+  imports =
+    [
+       ./hardware-configuration.nix
+       ./packages/vim.nix
+       ./users.nix
+    ];
+
+  boot = {
+	loader = {
+		grub = {
+			enable = true;
+			version = 2;
+			device = "/dev/sda"; # nodev for EFI only
+			
+			# EFI
+			efiSupport = false;
+			efiInstallAsRemovable = false;
+		};
+	};
+  };
+
+  networking = {
+	hostName = lib.mkDefault "Rory-nix-base";
+		
+	firewall = {
+		enable = false;
+		# allowedTCPPorts = [ ... ];
+		# allowedUDPPorts = [ ... ];
+	};
+  };
+
+  #time.timeZone = "Europe/Brussels";
+  i18n.defaultLocale = "en_US.UTF-8";
+
+  services = {
+	openssh = {
+          enable = true;
+          #allow more logins in cases where i have many ssh keys on a system
+          extraConfig = ''
+            MaxAuthTries 32
+            '';
+	};	
+  };
+
+  security.sudo.wheelNeedsPassword = false;
+  nixpkgs.config.allowUnfree = true;
+
+  sound.enable = true;
+  hardware.pulseaudio.enable = true;
+
+  users.users.Rory = {
+    isNormalUser = true;
+    extraGroups = [ "wheel" ];
+    packages = with pkgs; [
+    ];
+    initialPassword = "password";
+  };
+
+  environment.systemPackages = with pkgs; [
+    wget
+    neofetch
+    lnav
+    zsh
+    feh
+    git
+    lsd
+    #sshfs
+    kitty.terminfo
+    vimPlugins.vim-nix
+  ];
+
+
+  system.stateVersion = "22.11"; # DO NOT EDIT!
+}
+
diff --git a/modules/packages/vim.nix b/modules/packages/vim.nix
new file mode 100644
index 0000000..3524e2c
--- /dev/null
+++ b/modules/packages/vim.nix
@@ -0,0 +1,22 @@
+{ pkgs, ... }:
+{
+  environment.variables = { EDITOR = "vim"; };
+
+  environment.systemPackages = with pkgs; [
+    (neovim.override {
+      vimAlias = true;
+      configure = {
+        packages.myPlugins = with pkgs.vimPlugins; {
+          start = [ vim-lastplace vim-nix vim-airline ]; 
+          opt = [];
+        };
+        customRC = ''
+          " your custom vimrc
+          set nocompatible
+          set backspace=indent,eol,start
+          " ...
+        '';
+      };
+    }
+  )];
+}
diff --git a/modules/users.nix b/modules/users.nix
new file mode 100644
index 0000000..15e76a0
--- /dev/null
+++ b/modules/users.nix
@@ -0,0 +1,13 @@
+{ config, pkgs, ... }:
+
+{
+
+  users.users.Rory = {
+    isNormalUser = true;
+    extraGroups = [ "wheel" ];
+    packages = with pkgs; [
+    ];
+    initialPassword = "password";
+  };
+}
+
diff --git a/old/configuration.nix b/old/configuration.nix
new file mode 100644
index 0000000..1d99ef6
--- /dev/null
+++ b/old/configuration.nix
@@ -0,0 +1,117 @@
+{ config, pkgs, ... }:
+
+{
+  imports =
+    [
+       ./hardware-configuration.nix
+       ./vim.nix
+    ];
+
+  boot = {
+	loader = {
+		grub = {
+			enable = true;
+			version = 2;
+			device = "/dev/sda"; # nodev for EFI only
+			
+			# EFI
+			efiSupport = false;
+			efiInstallAsRemovable = false;
+		};
+	};
+  };
+
+  networking = {
+	hostName = "RoryNix";
+	networkmanager.enable = true;
+	wireless.enable = false;
+  	
+	firewall = {
+		enable = false;
+		# allowedTCPPorts = [ ... ];
+		# allowedUDPPorts = [ ... ];
+	};
+  };
+
+  time.timeZone = "Europe/Brussels";
+  i18n.defaultLocale = "en_US.UTF-8";
+
+  services = {
+ 	xserver = {
+		enable = true;
+  		videoDrivers = [ "intel" ];
+  		desktopManager.gnome.enable = true;
+		libinput.enable = true;
+		layout = "us";
+		modules = [ pkgs.xorg.xf86videointel ];
+	};
+	gnome = {
+		
+    		core-developer-tools.enable = false;
+		core-utilities.enable = false;
+		tracker-miners.enable = false;
+		tracker.enable = false;
+	};
+
+	printing.enable = false;
+	openssh = {
+          enable = true;
+          extraConfig = ''
+            MaxAuthTries 32
+            '';
+	};	
+  };
+  security.sudo.wheelNeedsPassword = false;
+  nixpkgs.config.allowUnfree = true;
+
+  sound.enable = true;
+  hardware.pulseaudio.enable = true;
+
+  users.users.Rory = {
+    isNormalUser = true;
+    extraGroups = [ "wheel" ];
+    packages = with pkgs; [
+      #xterm
+      gnomeExtensions.vitals
+      gnomeExtensions.runcat
+    ];
+    initialPassword = "password";
+  };
+
+  environment.systemPackages = with pkgs; [
+    wget
+    neofetch
+    lnav
+    pciutils
+    zsh
+    gnome-console
+    feh
+    git
+    lsd
+    #nerdfonts
+    #element-web
+    sshfs
+    cinnamon.nemo
+    firefox-bin
+    kitty.terminfo
+    glxinfo
+    #epiphany
+    # Various extensions...
+    # - Gnome
+    #gnomeExtensions.vitals
+    #gnomeExtensions.runcat
+    #  - Dont work on gnome 43:
+    #gnomeExtensions.undecorate
+    #gnomeExtensions.inactivity
+    #gnomeExtensions.left-clock
+    # - Vim
+    vimPlugins.vim-nix
+  ];
+  fonts.fonts = with pkgs; [
+    (nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
+  ];
+
+
+  system.stateVersion = "22.11"; # DO NOT EDIT!
+}
+