diff --git a/clanModules/sshd/default.nix b/clanModules/sshd/default.nix index 43211638..25385c41 100644 --- a/clanModules/sshd/default.nix +++ b/clanModules/sshd/default.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: { services.openssh.enable = true; + services.openssh.settings.PasswordAuthentication = false; services.openssh.hostKeys = [ { diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 393fd574..3d3a36f5 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -121,9 +121,6 @@ theme: icon: material/weather-sunny name: Switch to light mode -extra_javascript: - - static/main.js - extra_css: - static/asciinema-player/custom-theme.css - static/asciinema-player/asciinema-player.css diff --git a/docs/site/static/main.js b/docs/site/static/main.js deleted file mode 100644 index a8e66e42..00000000 --- a/docs/site/static/main.js +++ /dev/null @@ -1,72 +0,0 @@ - - -let preferDarkTheme = prefersDarkMode(); -let theme = localStorage.getItem('theme'); -if (theme !== null) { - setColorTheme(theme); -} else { - setColorTheme(preferDarkTheme ? "dark" : "light"); -} - -// Get the media query list object for the prefers-color-scheme media feature -const colorSchemeQueryList = window.matchMedia("(prefers-color-scheme: dark)"); -// Add an event listener for the change event -colorSchemeQueryList.addEventListener("change", handleColorSchemeChange); - - -function setColorTheme(theme) { - if (theme === "dark") { - document.body.setAttribute('data-md-color-scheme', 'slate'); - document.body.setAttribute('data-md-color-media', '(prefers-color-scheme: dark)') - localStorage.setItem('theme', 'dark'); - } else { - document.body.setAttribute('data-md-color-scheme', 'default'); - document.body.setAttribute('data-md-color-media', '(prefers-color-scheme: light)') - localStorage.setItem('theme', 'light'); - } -} - -// A function that returns true if the user prefers dark mode, false otherwise -function prefersDarkMode() { - // Check if the browser supports the prefers-color-scheme media query - if (window.matchMedia) { - // Get the current value of the media query - let colorScheme = window.matchMedia("(prefers-color-scheme: dark)"); - // Return true if the media query matches, false otherwise - return colorScheme.matches; - } else { - // If the browser does not support the media query, return false by default - return false; - } -} - -// A function that executes some logic based on the color scheme preference -function handleColorSchemeChange(e) { - if (e.matches) { - // The user prefers dark mode - setColorTheme("dark"); - } else { - // The user prefers light mode - setColorTheme("light"); - } -} - -// Detects if user pressed on the "change theme" button -document.addEventListener('DOMContentLoaded', function () { - function handleThemeChange() { - const isDarkMode = document.body.getAttribute('data-md-color-media').includes('dark'); - console.log(`Theme is now ${isDarkMode ? 'dark' : 'light'}`); - - // Detect the current theme - } - - // Initial check - handleThemeChange(); - - // MutationObserver to detect changes to the `data-md-color-scheme` attribute - const observer = new MutationObserver(handleThemeChange); - observer.observe(document.body, { - attributes: true, - attributeFilter: ['data-md-color-media'] - }); -}); diff --git a/templates/new-clan/flake.nix b/templates/new-clan/flake.nix index 1acecd5a..45277e24 100644 --- a/templates/new-clan/flake.nix +++ b/templates/new-clan/flake.nix @@ -23,7 +23,6 @@ jon = { imports = [ ./modules/shared.nix - ./modules/disko.nix ./machines/jon/configuration.nix ]; @@ -56,7 +55,6 @@ sara = { imports = [ ./modules/shared.nix - ./modules/disko.nix ./machines/sara/configuration.nix ]; diff --git a/templates/new-clan/machines/jon/configuration.nix b/templates/new-clan/machines/jon/configuration.nix index e70188d6..9bb9b903 100644 --- a/templates/new-clan/machines/jon/configuration.nix +++ b/templates/new-clan/machines/jon/configuration.nix @@ -3,7 +3,13 @@ let username = config.networking.hostName; in { - imports = [ ./hardware-configuration.nix ]; + imports = [ + ./hardware-configuration.nix + ./disko.nix + ]; + + # Locale service discovery and mDNS + services.avahi.enable = true; services.xserver.enable = true; services.xserver.desktopManager.gnome.enable = true; diff --git a/templates/new-clan/modules/disko.nix b/templates/new-clan/machines/jon/disko.nix similarity index 100% rename from templates/new-clan/modules/disko.nix rename to templates/new-clan/machines/jon/disko.nix diff --git a/templates/new-clan/machines/sara/configuration.nix b/templates/new-clan/machines/sara/configuration.nix index 2d5eb246..7f28c060 100644 --- a/templates/new-clan/machines/sara/configuration.nix +++ b/templates/new-clan/machines/sara/configuration.nix @@ -4,7 +4,13 @@ let username = config.networking.hostName; in { - imports = [ ./hardware-configuration.nix ]; + imports = [ + ./hardware-configuration.nix + ./disko.nix + ]; + + # Locale service discovery and mDNS + services.avahi.enable = true; services.xserver.enable = true; services.xserver.desktopManager.gnome.enable = true; diff --git a/templates/new-clan/machines/sara/disko.nix b/templates/new-clan/machines/sara/disko.nix new file mode 100644 index 00000000..7a750958 --- /dev/null +++ b/templates/new-clan/machines/sara/disko.nix @@ -0,0 +1,41 @@ +{ lib, ... }: +{ + boot.loader.grub.efiSupport = lib.mkDefault true; + boot.loader.grub.efiInstallAsRemovable = lib.mkDefault true; + disko.devices = { + disk = { + main = { + type = "disk"; + # Set the following in flake.nix for each maschine: + # device = ; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; # for grub MBR + priority = 1; + }; + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/templates/new-clan/modules/shared.nix b/templates/new-clan/modules/shared.nix index 963b46f4..bcd3118e 100644 --- a/templates/new-clan/modules/shared.nix +++ b/templates/new-clan/modules/shared.nix @@ -4,7 +4,4 @@ clan-core.clanModules.sshd clan-core.clanModules.root-password ]; - - # Locale service discovery and mDNS - services.avahi.enable = true; }