diff --git a/flake.lock b/flake.lock index 97248d1d..dc76e5a6 100644 --- a/flake.lock +++ b/flake.lock @@ -39,7 +39,9 @@ "mobile-nixos": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "pkgs-mobile" + ] }, "locked": { "lastModified": 1630497267, @@ -57,21 +59,6 @@ } }, "nixpkgs": { - "locked": { - "lastModified": 1629048390, - "narHash": "sha256-do7HuXFSKyj4ulMlRvGigNZCqOaGD9i0M3OLkFQgEAc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e41ba38114055832e5ba4a851e9c00149eef3e4a", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" - } - }, - "nixpkgs_2": { "locked": { "lastModified": 1652975354, "narHash": "sha256-qP1DpEYQdSq7NZ542TSHffIT6xGm7MaSMG9faQWPcg0=", @@ -135,7 +122,7 @@ "inputs": { "home-manager": "home-manager", "mobile-nixos": "mobile-nixos", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "nurpkgs": "nurpkgs", "pkgs-gitea": "pkgs-gitea", "pkgs-mobile": "pkgs-mobile" diff --git a/flake.nix b/flake.nix index d8651f80..7bf72067 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,10 @@ # pkgs-mobile.url = "nixpkgs/5aaed40d22f0d9376330b6fa413223435ad6fee5"; # (untested) associated with HN comment 2022/01/16 https://hydra.nixos.org/build/164693256#tabs-buildinputs -- still tries to compile linux from source # pkgs-mobile.url = "nixpkgs/23d785aa6f853e6cf3430119811c334025bbef55"; # latest mobile-nixos:unstable:device.pine64-pinephone.aarch64-linux build 2022/02/20 https://hydra.nixos.org/build/167888996#tabs-buildinputs -- still tries to compile linux from source, fails building lvgui # this includes a patch to enable flake support - mobile-nixos.url = "github:ngi-nix/mobile-nixos/afe022e1898aa05381077a89c3681784e6074458"; + mobile-nixos = { + url = "github:ngi-nix/mobile-nixos/afe022e1898aa05381077a89c3681784e6074458"; + inputs.nixpkgs.follows = "pkgs-mobile"; + }; home-manager = { url = "github:nix-community/home-manager/release-21.11"; inputs.nixpkgs.follows = "nixpkgs"; @@ -40,74 +43,33 @@ machines.moby = { nixosConfiguration = pkgs-mobile.lib.nixosSystem { - # inherit (self.genpkgs.aarch64-linux) pkgs; system = "aarch64-linux"; + specialArgs = { inherit home-manager; inherit nurpkgs; }; modules = [ mobile-nixos.nixosModules.pine64-pinephone ({ users.users.root.password = "147147"; }) - ({ pkgs, ... }: { - # 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 = "21.11"; # Did you read the comment? + ({ config, pkgs, ... }: { + nixpkgs.config.allowUnfree = true; + nixpkgs.overlays = [ nurpkgs.overlay ]; }) - # ({ pkgs, mobile-nixos, ... }: { - # imports = [ - # (import "${mobile-nixos}/lib/configuration.nix" { device = "pine64-pinephone"; }) - # ]; - # }) - # ({ pkgs, ... }: { - # imports = [ - # /devices/pine64-pinephone - # ]; - # }) + ./machines/moby ]; }; img = (pkgs-mobile.lib.nixosSystem { - # inherit (self.genpkgs.aarch64-linux) pkgs; system = "aarch64-linux"; + specialArgs = { inherit home-manager; inherit nurpkgs; }; modules = [ mobile-nixos.nixosModules.pine64-pinephone ({ users.users.root.password = "147147"; }) - ({ pkgs, ... }: { - # 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 = "21.11"; # Did you read the comment? + ({ config, pkgs, ... }: { + nixpkgs.config.allowUnfree = true; + nixpkgs.overlays = [ nurpkgs.overlay ]; }) - # ({ pkgs, mobile-nixos, ... }: { - # imports = [ - # (import "${mobile-nixos}/lib/configuration.nix" { device = "pine64-pinephone"; }) - # ]; - # }) - # ({ pkgs, ... }: { - # imports = [ - # /devices/pine64-pinephone - # ]; - # }) + ./machines/moby ]; }).config.mobile.outputs.u-boot.disk-image; - # img = nixosConfiguration.config.system.build.disk-image; - # img = (pkgs-mobile.lib.nixosSystem { - # system = "aarch64-linux"; - # modules = [ - # mobile-nixos.nixosModules.pine64-pinephone ({ - # users.users.root.password = "147147"; - # }) - # ({ pkgs, ... }: { - # system.stateVersion = "21.11"; # Did you read the comment? - # }) - # ./image.nix - # ]; - # }).config.system.build.raw; }; nixosConfigurations = builtins.mapAttrs (name: value: value.nixosConfiguration) self.machines; @@ -142,6 +104,7 @@ ); # apply all our package overlays, but to all platforms possible. + # genpkgs = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all (system: genpkgs = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all (system: { pkgs = import nixpkgs { @@ -149,6 +112,7 @@ config.allowUnfree = true; overlays = [ + #mobile-nixos.overlay nurpkgs.overlay (next: prev: { #### customized packages diff --git a/machines/common/gui.nix b/machines/common/gui.nix new file mode 100644 index 00000000..784740ed --- /dev/null +++ b/machines/common/gui.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: + +{ + # start gnome/gdm on boot + services.xserver.enable = true; + services.xserver.desktopManager.gnome.enable = true; + services.xserver.displayManager.gdm.enable = true; + + networking.useDHCP = false; + networking.networkmanager.enable = true; + networking.wireless.enable = lib.mkForce false; +} diff --git a/machines/common/hardware.nix b/machines/common/hardware.nix index a445c538..18eb2d12 100644 --- a/machines/common/hardware.nix +++ b/machines/common/hardware.nix @@ -21,6 +21,7 @@ # enable cross compilation boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + # nixpkgs.crossSystem.system = "aarch64-linux"; powerManagement.cpuFreqGovernor = "powersave"; hardware.enableRedistributableFirmware = true; @@ -47,11 +48,6 @@ time.timeZone = "America/Los_Angeles"; - # start gnome/gdm on boot - services.xserver.enable = true; - services.xserver.desktopManager.gnome.enable = true; - services.xserver.displayManager.gdm.enable = true; - # services.snapper.configs = { # root = { # subvolume = "/"; @@ -61,9 +57,4 @@ # }; # }; # services.snapper.snapshotInterval = "daily"; - - networking.useDHCP = false; - networking.networkmanager.enable = true; - networking.wireless.enable = lib.mkForce false; - } diff --git a/machines/desko/default.nix b/machines/desko/default.nix index 6e83cbde..d52194c5 100644 --- a/machines/desko/default.nix +++ b/machines/desko/default.nix @@ -4,6 +4,7 @@ ./../common/homes.nix ./../common/users.nix ./../common/hardware.nix + ./../common/gui.nix ./fs.nix ]; } diff --git a/machines/lappy/default.nix b/machines/lappy/default.nix index 6e83cbde..d52194c5 100644 --- a/machines/lappy/default.nix +++ b/machines/lappy/default.nix @@ -4,6 +4,7 @@ ./../common/homes.nix ./../common/users.nix ./../common/hardware.nix + ./../common/gui.nix ./fs.nix ]; } diff --git a/machines/moby/colin.nix b/machines/moby/colin.nix new file mode 100644 index 00000000..a5645a70 --- /dev/null +++ b/machines/moby/colin.nix @@ -0,0 +1,128 @@ +# docs: +# https://rycee.gitlab.io/home-manager/ +# man home-configuration.nix + +{ config, pkgs, ... }: +{ + + home.stateVersion = "21.11"; + home.username = "colin"; + home.homeDirectory = "/home/colin"; + programs.home-manager.enable = true; + programs.zsh.enable = true; + programs.git = { + enable = true; + userName = "colin"; + userEmail = "colin@uninsane.org"; + }; + + programs.firefox = { + enable = true; + # empty profile required to allow extensions below + profiles.default = { + # settings = { + # "browser.urlbar.placeholderName" = "DuckDuckGo"; + # }; + }; + # NB: these must be manually enabled in the Firefox settings on first start + # extensions can be found here: https://gitlab.com/rycee/nur-expressions/-/blob/master/pkgs/firefox-addons/addons.json + extensions = [ + pkgs.nur.repos.rycee.firefox-addons.bypass-paywalls-clean + pkgs.nur.repos.rycee.firefox-addons.i-dont-care-about-cookies + pkgs.nur.repos.rycee.firefox-addons.sidebery + pkgs.nur.repos.rycee.firefox-addons.sponsorblock + pkgs.nur.repos.rycee.firefox-addons.ublock-origin + ]; + }; + + programs.vim = { + enable = true; + extraConfig = '' + " wtf vim project: NOBODY LIKES MOUSE FOR VISUAL MODE + set mouse-=a + " copy/paste to system clipboard + set clipboard=unnamedplus + " completion menu settings + set wildmenu + set wildmode=longest,list,full + " highlight all matching searches (using / and ?) + set hlsearch + " allow backspace to delete empty lines in insert mode + set backspace=indent,eol,start + " built-in syntax highlighting + syntax enable + " show line/col number in bottom right + set ruler + " highlight trailing space & related syntax errors (does this work?) + let c_space_errors=1 + let python_space_errors=1 + ''; + }; + + dconf.settings = { + # control alt-tab behavior + "org/gnome/desktop/wm/keybindings" = { + switch-applications = [ "Tab" ]; + switch-applications-backward=[]; + switch-windows=["Tab"]; + switch-windows-backward=["Tab"]; + }; + # idle power savings + "org/gnome/settings-deamon/plugins/power" = { + idle-brigthness = 50; + sleep-inactive-ac-type = "nothing"; + sleep-inactive-battery-timeout = 5400; # seconds + }; + }; + + # xsession.enable = true; + # xsession.windowManager.command = "…"; + + + home.packages = [ + pkgs.btrfs-progs + pkgs.gnumake + pkgs.dig + pkgs.duplicity + pkgs.fatresize + pkgs.fd + pkgs.file + pkgs.gptfdisk + pkgs.hdparm + pkgs.htop + pkgs.iftop + pkgs.iotop + pkgs.iptables + pkgs.jq + pkgs.killall + pkgs.lm_sensors # for sensors-detect + pkgs.lsof + pkgs.pciutils + pkgs.matrix-synapse + pkgs.mix2nix + pkgs.netcat + pkgs.nixUnstable + # pkgs.nixos-generators + # pkgs.nettools + pkgs.nmap + pkgs.parted + pkgs.powertop + pkgs.python3 + pkgs.ripgrep + pkgs.smartmontools + pkgs.snapper + pkgs.socat + pkgs.sudo + pkgs.telnet + pkgs.usbutils + pkgs.wireguard + pkgs.zola + + pkgs.clinfo + # pkgs.discord + pkgs.element-desktop + pkgs.gnome.dconf-editor + pkgs.mesa-demos + pkgs.tdesktop + ]; +} diff --git a/machines/moby/default.nix b/machines/moby/default.nix new file mode 100644 index 00000000..9bd36f34 --- /dev/null +++ b/machines/moby/default.nix @@ -0,0 +1,18 @@ +{ home-manager, config, pkgs, ... }: +{ + imports = [ + ./homes.nix + ./../common/users.nix + ./../common/gui.nix + # ./../common/hardware.nix + # ./fs.nix + ]; + + # 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 = "21.11"; # Did you read the comment? +} diff --git a/machines/moby/homes.nix b/machines/moby/homes.nix new file mode 100644 index 00000000..fb1c31ff --- /dev/null +++ b/machines/moby/homes.nix @@ -0,0 +1,8 @@ +{ home-manager, config, pkgs, ... }: +{ + imports = [ home-manager.nixosModule ]; + + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.colin.imports = [ ./colin.nix ]; +}