diff --git a/.gitignore b/.gitignore index e1fe8abb..b6c61f59 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ pkgs/_sources/.shake* tags /owners + +results diff --git a/flake.lock b/flake.lock index c8ad8270..1f6cd724 100644 --- a/flake.lock +++ b/flake.lock @@ -242,6 +242,31 @@ "type": "github" } }, + "nixos-apple-silicon": { + "inputs": { + "flake-compat": [ + "flake-compat" + ], + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1738646032, + "narHash": "sha256-57BdBE9anNpIpf48EiTVLGxg4mOQ04XjHCEP0gLTsFA=", + "owner": "tpwrules", + "repo": "nixos-apple-silicon", + "rev": "e77031211944723a38bebc043e48847c36e43668", + "type": "github" + }, + "original": { + "owner": "tpwrules", + "ref": "releasep2-2024-12-25", + "repo": "nixos-apple-silicon", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1743167577, @@ -299,12 +324,29 @@ "lix-module": "lix-module", "nix-darwin": "nix-darwin", "nix-direnv": "nix-direnv", + "nixos-apple-silicon": "nixos-apple-silicon", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "unstable": "unstable", "watson": "watson" } }, + "rust-overlay": { + "flake": false, + "locked": { + "lastModified": 1686795910, + "narHash": "sha256-jDa40qRZ0GRQtP9EMZdf+uCbvzuLnJglTUI2JoHfWDc=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "5c2b97c0a9bc5217fc3dfb1555aae0fb756d99f9", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index ea66ba7d..5cea9cc6 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,10 @@ watson.url = "github:pub-solar/watson"; watson.inputs.nixpkgs.follows = "nixpkgs"; watson.inputs.flake-parts.follows = "flake-parts"; + + nixos-apple-silicon.url = "github:tpwrules/nixos-apple-silicon?ref=releasep2-2024-12-25"; + nixos-apple-silicon.inputs.nixpkgs.follows = "nixpkgs"; + nixos-apple-silicon.inputs.flake-compat.follows = "flake-compat"; }; outputs = diff --git a/hosts/default.nix b/hosts/default.nix index da7d45c7..7255d12e 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -66,6 +66,28 @@ ]; }; + neo = self.inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + flake = { + inherit self inputs config; + }; + }; + modules = [ + self.nixosModules.base + ./neo + inputs.nixos-apple-silicon.nixosModules.default + self.nixosModules.teutat3s + self.nixosModules.audio + self.nixosModules.bluetooth + self.nixosModules.desktop-extended + self.nixosModules.docker + self.nixosModules.graphical + #self.nixosModules.nextcloud + #self.nixosModules.office + #self.nixosModules.printing + ]; + }; + fae = self.inputs.nixpkgs.lib.nixosSystem { specialArgs = { flake = { diff --git a/hosts/neo/.config/sway/config.d/input-defaults.conf b/hosts/neo/.config/sway/config.d/input-defaults.conf new file mode 100644 index 00000000..80c03cdd --- /dev/null +++ b/hosts/neo/.config/sway/config.d/input-defaults.conf @@ -0,0 +1,30 @@ +### Input configuration +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + +input "type:keyboard" { + xkb_layout us(intl),de + xkb_model pc105 + xkb_options ctrl:nocaps +} + +input "type:touchpad" { + tap enabled + natural_scroll enabled + # Disable while typing + dwt enabled +} + +# Screen brightness controls +bindsym XF86MonBrightnessUp exec "brightnessctl set +10%" +bindsym XF86MonBrightnessDown exec "brightnessctl set 10%-" + +# Pulse Audio controls +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%; exec pactl set-sink-mute @DEFAULT_SINK@ 0 #increase sound volume +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%; exec pactl set-sink-mute @DEFAULT_SINK@ 0 #decrease sound volume +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle # mute sound +# Media player controls +bindsym XF86AudioPlay exec "playerctl play-pause; notify-send 'Play/Pause'" +bindsym XF86AudioNext exec "playerctl next; notify-send 'Next'" +bindsym XF86AudioPrev exec "playerctl previous; notify-send 'Prev.'" diff --git a/hosts/neo/default.nix b/hosts/neo/default.nix new file mode 100644 index 00000000..4fe6e64f --- /dev/null +++ b/hosts/neo/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./neo.nix + ./hardware-configuration.nix + ]; +} diff --git a/hosts/neo/firmware/all_firmware.tar.gz b/hosts/neo/firmware/all_firmware.tar.gz new file mode 100755 index 00000000..39c48157 Binary files /dev/null and b/hosts/neo/firmware/all_firmware.tar.gz differ diff --git a/hosts/neo/firmware/kernelcache.release.mac14j b/hosts/neo/firmware/kernelcache.release.mac14j new file mode 100755 index 00000000..9f95e2bb Binary files /dev/null and b/hosts/neo/firmware/kernelcache.release.mac14j differ diff --git a/hosts/neo/hardware-configuration.nix b/hosts/neo/hardware-configuration.nix new file mode 100644 index 00000000..61add76e --- /dev/null +++ b/hosts/neo/hardware-configuration.nix @@ -0,0 +1,39 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "usb_storage" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/914e73e5-596f-409e-933a-9b29a7047ace"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/2022c72f-e309-4f8b-b591-03ca89a5cb49"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/84BE-1608"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + # 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 + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} diff --git a/hosts/neo/neo.nix b/hosts/neo/neo.nix new file mode 100644 index 00000000..7d91ba20 --- /dev/null +++ b/hosts/neo/neo.nix @@ -0,0 +1,166 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: +let + psCfg = config.pub-solar; +in +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + pub-solar.terminal-life.full = true; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = false; + + boot.kernelParams = [ + "hid_apple.fnmode=2" + ]; + + # Specify path to peripheral firmware files + hardware.asahi = { + peripheralFirmwareDirectory = ./firmware; + withRust = true; + useExperimentalGPUDriver = true; + experimentalGPUInstallMode = "replace"; + setupAsahiSound = true; + }; + + # Enable udev rules for gnupg smart cards + hardware.gpgSmartcards.enable = true; + + #hardware.keyboard.uhk.enable = true; + + networking.hostName = "neo"; # Define your hostname. + + services.fstrim.enable = true; + + home-manager = + pkgs.lib.setAttrByPath + [ + "users" + psCfg.user.name + ] + { + # Custom device sway configs + xdg.configFile = { + #"sway/config.d/10-applications.conf".source = ./.config/sway/config.d/applications.conf; + #"sway/config.d/autostart.conf".source = ./.config/sway/config.d/autostart.conf; + #"sway/config.d/10-custom-keybindings.conf".source = ./.config/sway/config.d/custom-keybindings.conf; + "sway/config.d/input-defaults.conf".source = ./.config/sway/config.d/input-defaults.conf; + #"sway/config.d/screens.conf".source = ./.config/sway/config.d/screens.conf; + }; + }; + + + # Pick only one of the below networking options. + #networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + #networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + + # Set your time zone. + #time.timeZone = "Europe/Berlin"; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # useXkbConfig = true; # use xkb.options in tty. + # }; + + # Enable the X11 windowing system. + # services.xserver.enable = true; + #programs.sway.enable = true; + + + + # Configure keymap in X11 + # services.xserver.xkb.layout = "us"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # hardware.pulseaudio.enable = true; + # OR + # services.pipewire = { + # enable = true; + # pulse.enable = true; + # }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + #users.users.nixos = { + # isNormalUser = true; + # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + # packages = with pkgs; [ + # tree + # ]; + #}; + + # programs.firefox.enable = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + #environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + #]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "24.11"; # Did you read the comment? + +} + diff --git a/overlays/prr.nix b/overlays/prr.nix index 8a31e5f4..724f3d63 100644 --- a/overlays/prr.nix +++ b/overlays/prr.nix @@ -23,7 +23,7 @@ final: prev: { meta = with prev.lib; { homepage = "https://github.com/TritonDataCenter/prr"; description = "Tooling to assist with GitHub pull requests"; - platforms = [ "x86_64-linux" ]; + platforms = [ "x86_64-linux" "aarch64-linux" ]; maintainers = with maintainers; [ teutat3s ]; }; }; diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix index baf4059e..96815a6c 100644 --- a/pkgs/_sources/generated.nix +++ b/pkgs/_sources/generated.nix @@ -11,7 +11,7 @@ fetchSubmodules = true; deepClone = false; leaveDotGit = true; - sha256 = "sha256-Sm+Vt4FI+OAEFSKTp0ddIaZVqoa4ICitNcD6xFx2TL4="; + sha256 = "sha256-+rb/yUjTdZOtrDLENTkkujYWhTKMcS3spFgxQVZmNh8="; }; date = "2024-04-20"; }; diff --git a/secrets/secrets.nix b/secrets/secrets.nix index e3bf9399..9002977b 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -3,6 +3,7 @@ let machines = { dumpyourvms = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILDATEWAgDZFfYs1ZPh33Kg4sqQ9tWMVKyk8XqFu3Koe host@dumpyourvms"; ryzensun = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH/l7MfEmt510BMeNjuXNPmZ0brcQidvrrpcea+qJMjX root@ryzensun"; + neo = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1zkA1CMuEnnYwdThDxcDp5uPB33L+m8AEom+F8sAHY root@neo"; fae = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINP3xI8c8+SI5QPTHqR0YIwKvG8x2MJGC/arBu4BkCP0 root@fae"; }; users = { @@ -12,6 +13,7 @@ let allKeys = [ machines.dumpyourvms machines.ryzensun + machines.neo users.teutat3s users.teutat3s-5-nfc ]; diff --git a/users/teutat3s/home.nix b/users/teutat3s/home.nix index 4b9d8c9f..f217af1c 100644 --- a/users/teutat3s/home.nix +++ b/users/teutat3s/home.nix @@ -64,23 +64,28 @@ in inherit pkgs; }; - home.packages = with pkgs; [ - AusweisApp2 - drone-docker-runner - gpu-switch - ifmetric - ipmitool - thunderbird-128 - veracrypt - age-plugin-yubikey - #cockroach-bin - obs-studio - scan2paperless - wlvncc - uhk-agent - restic - notes - ]; + home.packages = + with pkgs; + [ + AusweisApp2 + drone-docker-runner + gpu-switch + ifmetric + ipmitool + thunderbird-128 + veracrypt + age-plugin-yubikey + #cockroach-bin + scan2paperless + wlvncc + restic + notes + ] + ++ lib.optionals stdenv.hostPlatform.isLinux + && stdenv.hostPlatform.isx86_64 [ + obs-studio + uhk-agent + ]; programs.bash.initExtra = '' source ${config.age.secrets.environment-secrets.path} diff --git a/users/teutat3s/mnx.nix b/users/teutat3s/mnx.nix index bc27ba0b..3f651d76 100644 --- a/users/teutat3s/mnx.nix +++ b/users/teutat3s/mnx.nix @@ -44,14 +44,19 @@ in psCfg.user.name ] { - home.packages = with pkgs; [ - zoom-us - slack - notion-repackaged - prr - tmate - jira-cli-go - ]; + home.packages = + with pkgs; + [ + prr + tmate + jira-cli-go + ] + ++ lib.optionals stdenv.hostPlatform.isLinux + && stdenv.hostPlatform.isx86_64 [ + zoom-us + slack + notion-repackaged + ]; }; }; }