From 4fb53d84409be0ffbfea07e4629f642d19020ea6 Mon Sep 17 00:00:00 2001 From: Radu Andries Date: Thu, 7 Dec 2023 15:21:04 +0100 Subject: [PATCH] Initial commit --- features/audio.nix | 14 +++++++ features/bluetooth.nix | 5 +++ flake.lock | 71 ++++++++++++++++++++++++++++++++ flake.nix | 25 ++++++++++++ flavours/jovian.nix | 10 +++++ systems/aphrodite.nix | 92 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 217 insertions(+) create mode 100644 features/audio.nix create mode 100644 features/bluetooth.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 flavours/jovian.nix create mode 100644 systems/aphrodite.nix diff --git a/features/audio.nix b/features/audio.nix new file mode 100644 index 0000000..b179366 --- /dev/null +++ b/features/audio.nix @@ -0,0 +1,14 @@ +{ ... }: + +{ + services.pipewire = { + enable = true; + # too slow to activate + socketActivation = false; + pulse.enable = true; + jack.enable = true; + alsa.support32Bit = true; + alsa.enable = true; + audio.enable = true; + }; +} \ No newline at end of file diff --git a/features/bluetooth.nix b/features/bluetooth.nix new file mode 100644 index 0000000..c9d3a4e --- /dev/null +++ b/features/bluetooth.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + hardware.bluetooth.enable = true; +} \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..261c5fc --- /dev/null +++ b/flake.lock @@ -0,0 +1,71 @@ +{ + "nodes": { + "jovian": { + "inputs": { + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701953467, + "narHash": "sha256-dpx/o701Jj7YGN+8D2ccY6gloGZ10hMSQs+ddhD+7v4=", + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "rev": "fb984b33b033e8ed625a11c95b313eefc3ebb99e", + "type": "github" + }, + "original": { + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "jovian", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1690328911, + "narHash": "sha256-fxtExYk+aGf2YbjeWQ8JY9/n9dwuEt+ma1eUFzF8Jeo=", + "owner": "zhaofengli", + "repo": "nix-github-actions", + "rev": "96df4a39c52f53cb7098b923224d8ce941b64747", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "matrix-name", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1701718080, + "narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "jovian": "jovian", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2231741 --- /dev/null +++ b/flake.nix @@ -0,0 +1,25 @@ +{ + description = "admiral0's Flakes"; + + inputs = { + nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable"; }; + jovian = { + url = "github:Jovian-Experiments/Jovian-NixOS"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, jovian }@attrs: { + nixosConfigurations = { + aphrodite = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + jovian.nixosModules.jovian + ./systems/aphrodite.nix + ]; + specialArgs = attrs; + }; + }; + + }; +} diff --git a/flavours/jovian.nix b/flavours/jovian.nix new file mode 100644 index 0000000..437a891 --- /dev/null +++ b/flavours/jovian.nix @@ -0,0 +1,10 @@ +# My configuration for steam htpc x86 systems +{ ... }: + +{ + jovian.steam = { + enable = true; + autoStart = true; + user = "admiral0"; + }; +} \ No newline at end of file diff --git a/systems/aphrodite.nix b/systems/aphrodite.nix new file mode 100644 index 0000000..a53afcf --- /dev/null +++ b/systems/aphrodite.nix @@ -0,0 +1,92 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ../features/audio.nix + ../features/bluetooth.nix + ../flavours/jovian.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + # Mounts + fileSystems."/" = + { device = "/dev/disk/by-uuid/2c1ea652-9778-444d-9735-abdf94572265"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/0CA8-BA03"; + fsType = "vfat"; + }; + swapDevices = [ ]; + + networking.hostName = "aphrodite"; # Define your hostname + + # Steam talks with network manager + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Rome"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "it_IT.UTF-8"; + LC_IDENTIFICATION = "it_IT.UTF-8"; + LC_MEASUREMENT = "it_IT.UTF-8"; + LC_MONETARY = "it_IT.UTF-8"; + LC_NAME = "it_IT.UTF-8"; + LC_NUMERIC = "it_IT.UTF-8"; + LC_PAPER = "it_IT.UTF-8"; + LC_TELEPHONE = "it_IT.UTF-8"; + LC_TIME = "it_IT.UTF-8"; + }; + + # Configure keymap in X11 + services.xserver = { + layout = "us"; + xkbVariant = ""; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.admiral0 = { + isNormalUser = true; + description = "Radu Andries"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; []; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = 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. + btop + neofetch + lshw + git + ]; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + # No need for a firewall + networking.firewall.enable = false; + + system.stateVersion = "23.05"; + +}