diff --git a/default.nix b/configuration.nix similarity index 97% rename from default.nix rename to configuration.nix index 701306d..67e70ba 100644 --- a/default.nix +++ b/configuration.nix @@ -91,7 +91,8 @@ in { # Install.WantedBy = [ "default.target" ]; # }; - system.stateVersion = "21.05"; + system.stateVersion = "21.11"; + nixpkgs.config.allowUnfree = true; } diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e1c6732 --- /dev/null +++ b/flake.nix @@ -0,0 +1,8 @@ +{ + outputs = { self, nixpkgs }: { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ /etc/nixos/hardware-configuration.nix ./configuration.nix ]; + }; + }; +} diff --git a/modules/applications/misc.nix b/modules/applications/misc.nix index 7d87321..23b7344 100644 --- a/modules/applications/misc.nix +++ b/modules/applications/misc.nix @@ -39,7 +39,6 @@ # chat apps discord - # discord-canary # deluge # slack # tdesktop # telegram for the desktop diff --git a/modules/default.nix b/modules/default.nix index 3ab0c8b..33a93b6 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,10 +3,11 @@ ./dev ./applications ./theme + ./overlays ./network.nix ./xserver.nix ./users.nix - ./overlay.nix + ./nix.nix ]; } diff --git a/modules/network.nix b/modules/network.nix index 6de5058..16556db 100644 --- a/modules/network.nix +++ b/modules/network.nix @@ -3,9 +3,6 @@ networkmanager.enable = true; hostName = "nixos"; - # The global useDHCP flag is deprecated, therefore explicitly set to false here. - # Per-interface useDHCP will be mandatory in the future, so this generated config - # replicates the default behaviour. useDHCP = false; interfaces.enp1s0.useDHCP = true; interfaces.wlp0s20f3.useDHCP = true; diff --git a/modules/nix.nix b/modules/nix.nix new file mode 100644 index 0000000..7a81f9f --- /dev/null +++ b/modules/nix.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: { + nix = { + trustedUsers = [ "root" "adrielus" "@wheel" ]; + autoOptimiseStore = true; + gc.automatic = true; + optimise.automatic = true; + binaryCaches = [ "https://cache.nixos.org" "https://all-hies.cachix.org" ]; + binaryCachePublicKeys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "all-hies.cachix.org-1:JjrzAOEUsD9ZMt8fdFbzo3jNAyEWlPAwdVuHw4RD43k=" + ]; + + # Emanble nix flakes + package = pkgs.nixFlakes; + extraOptions = '' + experimental-features = nix-command flakes + ''; + }; +} diff --git a/modules/overlays/default.nix b/modules/overlays/default.nix new file mode 100644 index 0000000..dd052fb --- /dev/null +++ b/modules/overlays/default.nix @@ -0,0 +1,4 @@ +{ ... }: { + # nixpkgs.overlays = [ import ./discord ]; + imports = [ ./legacy.nix ]; +} diff --git a/modules/overlays/discord.nix b/modules/overlays/discord.nix new file mode 100644 index 0000000..eea5e40 --- /dev/null +++ b/modules/overlays/discord.nix @@ -0,0 +1,12 @@ +self: super: + +{ + discord = super.discord.overrideAttrs (old: rec { + version = "0.0.15"; + src = builtins.fetchurl { + url = + "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz"; + sha256 = "0pn2qczim79hqk2limgh88fsn93sa8wvana74mpdk5n6x5afkvdd"; + }; + }); +} diff --git a/modules/overlay.nix b/modules/overlays/legacy.nix similarity index 61% rename from modules/overlay.nix rename to modules/overlays/legacy.nix index 9f8a50b..6f123ae 100644 --- a/modules/overlay.nix +++ b/modules/overlays/legacy.nix @@ -1,7 +1,7 @@ { ... }: let - imports = import ../nix/sources.nix; - edoproPackage = import ./applications/edopro.nix; + imports = import ../../nix/sources.nix; + edoproPackage = import ./../applications/edopro.nix; unstable = import imports.nixpkgs-unstable { config.allowUnfree = true; config.allowBroken = true; @@ -33,25 +33,8 @@ in { vscode = unstable.vscode; docker-compose = unstable.docker-compose; deno = unstable.deno; - # discord = unstable.discord; - discord-canary = unstable.discord-canary; dotnet-sdk = unstable.dotnet-sdk_5; elm-repl = unstable.haskellPackages.elm-repl; }) ]; - - # allow packages with unfree licenses - nixpkgs.config.allowUnfree = true; - - nix = { - trustedUsers = [ "root" "adrielus" "@wheel" ]; - autoOptimiseStore = true; - gc.automatic = true; - optimise.automatic = true; - binaryCaches = [ "https://cache.nixos.org" "https://all-hies.cachix.org" ]; - binaryCachePublicKeys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "all-hies.cachix.org-1:JjrzAOEUsD9ZMt8fdFbzo3jNAyEWlPAwdVuHw4RD43k=" - ]; - }; } diff --git a/nix/sources.json b/nix/sources.json index 842e1a3..a7377d7 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "", "owner": "nix-community", "repo": "NUR", - "rev": "a6d41ad68b659457e0dea467479ea5e617f83786", - "sha256": "1j12bccakyz00vlac7qjpl0bd7il6rgw48yzc014pji03alhh4y7", + "rev": "b94538af2a15e0b1f139c72bb40ad0cfcfffb869", + "sha256": "07mkli320qzfzv7hafkwhc1xg78d8hc2b31ny4yary52sni2bkhs", "type": "tarball", - "url": "https://github.com/nix-community/NUR/archive/a6d41ad68b659457e0dea467479ea5e617f83786.tar.gz", + "url": "https://github.com/nix-community/NUR/archive/b94538af2a15e0b1f139c72bb40ad0cfcfffb869.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "agnoster": { @@ -41,10 +41,10 @@ "homepage": "", "owner": "xzfc", "repo": "cached-nix-shell", - "rev": "8b87dc0047f35fec4f7a132d0e1b67d0526a22f5", - "sha256": "1cryshs5w67xg8j3dsy3z4ia6hxzdv6jzz25jwd1m27jci4035qy", + "rev": "1955b9d0aaaf90337541ab799d5071eeaac2360c", + "sha256": "17v38llx83mp05a0axjxcd2zyafd57syh7xhx5cq6qibcbha0by9", "type": "tarball", - "url": "https://github.com/xzfc/cached-nix-shell/archive/8b87dc0047f35fec4f7a132d0e1b67d0526a22f5.tar.gz", + "url": "https://github.com/xzfc/cached-nix-shell/archive/1955b9d0aaaf90337541ab799d5071eeaac2360c.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "easy-dhall-nix": { @@ -65,10 +65,10 @@ "homepage": "", "owner": "justinwoo", "repo": "easy-purescript-nix", - "rev": "eb64583e3e15749b3ae56573b2aebbaa9cbab4eb", - "sha256": "0hr7smk7avdgc5nm1r3drq91j1hf8wimp7sg747832345c8vq19a", + "rev": "82f901ce0a2d86327e2d65993a75c2ea74f229f2", + "sha256": "0qsq8bj76y3bxdl2iphknjib139z0jw75xlaih7viv9kvfm9b1lx", "type": "tarball", - "url": "https://github.com/justinwoo/easy-purescript-nix/archive/eb64583e3e15749b3ae56573b2aebbaa9cbab4eb.tar.gz", + "url": "https://github.com/justinwoo/easy-purescript-nix/archive/82f901ce0a2d86327e2d65993a75c2ea74f229f2.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "home-manager": { @@ -89,10 +89,10 @@ "homepage": "https://github.com/nmattia/niv", "owner": "nmattia", "repo": "niv", - "rev": "e0ca65c81a2d7a4d82a189f1e23a48d59ad42070", - "sha256": "1pq9nh1d8nn3xvbdny8fafzw87mj7gsmp6pxkdl65w2g18rmcmzx", + "rev": "5830a4dd348d77e39a0f3c4c762ff2663b602d4c", + "sha256": "1d3lsrqvci4qz2hwjrcnd8h5vfkg8aypq3sjd4g3izbc8frwz5sm", "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/e0ca65c81a2d7a4d82a189f1e23a48d59ad42070.tar.gz", + "url": "https://github.com/nmattia/niv/archive/5830a4dd348d77e39a0f3c4c762ff2663b602d4c.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { @@ -113,10 +113,10 @@ "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fe01052444c1d66ed6ef76df2af798c9769e9e79", - "sha256": "0z99hwxgrvlf0psicwd97kdqqcc3qngfzmcz7k68q6q868y8582y", + "rev": "715f63411952c86c8f57ab9e3e3cb866a015b5f2", + "sha256": "152kxfk11mgwg8gx0s1rgykyydfb7s746yfylvbwk5mk5cv4z9nv", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/fe01052444c1d66ed6ef76df2af798c9769e9e79.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/715f63411952c86c8f57ab9e3e3cb866a015b5f2.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "snack": {